Cleaning up CSS
- Started
- Last post
- 6 Responses
- dMullins
I've seen a number of reset.css sheets out there for reseting tags globally for margin, padding, etc.
Then this morning I was looking at this guy from India's site, and he had this in his style sheet:
* { margin:0; padding:0; list-style-type:none;}
Does that work across all browsers? It would be nice to be able to use that for cleaner code.
- trooperbill0
yes but according to google page speed its bad because it adds to page load
http://markrushworth.com/templat…
- JamesBoynton0
I just use a real simple reset, seems to work fine and is reasnobly neat.
html,body,
h1,h2,h3,h4,h5,h6,p,blockquote,a...
acronym,kbd,a,samp,img,ins,i,b,u...
,li,applet,object,iframe,form,fi...
tfoot,thead,tr,caption{font-size...
outline:0;font-weight:normal;fon...:focus{outline:0;}
blockquote:before,blockquote:aft...
q:before,q:after{content:"";}blockquote,q{quotes:"" "";}
img{display: block;}
- dMullins0
Ok, trooperbill, that was my other concern...whether or not it would load longer based on the fact it would be applying that to every elements.
- moth0
I'd think the benefits of a reset far outweigh a few milliseconds.
- pylon0
/* MEYER RESET */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0px;
padding: 0px;
border: 0px;
outline: 0px;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* END MEYER RESEST */:focus {
outline: 0;
}