Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Austin Govella http://thinkingandmaking.com

« Newer Snippets
Older Snippets »
7 total  XML / RSS feed 

XHTML 1.0 Strict template

// So I can stop typing it. Includes the basic DIVs I aways seem to use.

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title>

/html; charset=UTF-8" />
"imagetoolbar" content="no" />
"MSSmartTagsPreventParsing" content="true" />
"stylesheet" type="text/css" href="/styles/main.css" type="text/css" media="screen, projection" />


"stylesheet" type="text/css" href="/styles/print.css" type="text/css" media="print" />


"page">
"header">

Header

"content">
"footer">

Footer

XHTML 1.0 Transitional template

// So I can stop retyping it all the time

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title>
        
/html; charset=UTF-8" />
"imagetoolbar" content="no" />
"MSSmartTagsPreventParsing" content="true" />
"stylesheet" type="text/css" href="/styles/main.css" />

"page">
"header">

Header

"content">
"footer">

Footer

appendInputTypeClasses() - IE attribute selectors for form inputs

(Stolen from Jeremy Keith and Dustin Diaz: http://domscripting.com/blog/display/38).

Unobtrusive script takes a form inputs type attribute and copies it to that input's class. So, you go from...

<input type="text" />


...to...

<input type="text" class="text" />


Basically allows attribute selectors for form until IE catches up.

/*
        form.js
        AUTH: Austin Govella ([email protected])
        DATE: 2006-07-01
        DESC: Includes form specific javascripts.
        NOTE: Stolen from Jeremy Keith and Dustin Diaz: http://domscripting.com/blog/display/38
        REVS:  
*/



function appendInputTypeClasses()
{       /* adds input type as the inputs class */
        if ( !document.getElementsByTagName ) return;

        var inputs = document.getElementsByTagName('input');
        var inputLen = inputs.length;
        for ( i=0; i < inputLen; i++ )
        {
                if ( inputs[i].getAttribute('type') )
                {
                        inputs[i].className += ' '+inputs[i].getAttribute('type');
                }
        }
}

Baseline CSS FINAL - 2006-07-01

Resets CSS so all browsers are the same, and sets a cross-browser base font size (verdana 13px)

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
cite,code,em,strong,th{font-style:normal;font-weight:normal;}
ol,ul{list-style:none;}
th{text-align:left;}
h1,h2,h3,h4{font-size:100%;}
q:before,q:after{content:'';}
body{font:13px verdana,sans-serif;*font-size:small;*font:x-small;}
table{font-size:inherit;font:100%;}
select,input,textarea{font:99% verdana,sans-serif;}
pre,code{font:115% monospace;*font-size:100%;}
body*{line-height:1.22em;}

Baseline CSS - 2006-07-01

Base font-sizing added to base.css

/*
        Reset default styles // base.css
        AUTH: Austin Govella (austin.govella@gmail.com)
        DATE: 2006-05-11
        DESC: Resets default styles for all browsers (merges Tantek Celik's undohtml.css and Yahoo's reset.css), and
              sets base font size to 13px verdana (based on Y!'s fonts.css).
        NOTE: Included in main.css w/ @import
        REVS: 2006-05-12 - Removed elements not commonly used - ACG
              2006-07-01 - Added base font sizing - ACG 
*/



/* Reset default styles across browsers
---------------------------------------- */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
cite,code,em,strong,th{font-style:normal;font-weight:normal;}
ol,ul{list-style:none;}
th{text-align:left;}
h1,h2,h3,h4{font-size:100%;}
q:before,q:after{content:'';}



/* Set uniform base font size
---------------------------------------- */
body{font:13px verdana,sans-serif;*font-size:small;*font:x-small;}
table{font-size:inherit;font:100%;}
select,input,textarea{font:99% verdana,sans-serif;}
pre,code{font:115% monospace;*font-size:100%;}
body * {line-height:1.22em;}

Baseline CSS FINAL - 2006-05-12

CSS to remove default spacing and presentation formatting. Provides a consistent blank slate across all browsers.

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
cite,code,em,strong,th{font-style:normal;font-weight:normal;}
ol,ul{list-style:none;}
th{text-align:left;}
h1,h2,h3,h4{font-size:100%;}
q:before,q:after{content:'';}


349 bytes
« Newer Snippets
Older Snippets »
7 total  XML / RSS feed