CSS hacks

Most in-CSS hacks deal with selector bugs. The following is a list of browser version ranges and the beginnings of selectors that are known to select elements in them. Note that because these hacks rely on browser bugs or missing features, results may vary in some lesser-known or future browsers. All of these selectors use valid CSS.

IE 6 and below
* html {}
IE 7 and below
*:first-child+html {} * html {}
IE 7 only
*:first-child+html {}
IE 7 and modern browsers only



*:first-child+html {}
============================
sup,sub {
height: 0;
line-height: 1;
vertical-align: baseline;
_vertical-align: bottom;
position: relative;
}

sup {
bottom: 1ex;
}
sub {
top: .5ex;
}

sup.reg {
height: 0;
line-height: 1;
bottom: 1.2ex;
vertical-align: baseline;
position: relative;
text-decoration:none;
font-size:110%;
}
============================
@media print{}
============================
html>/**/body #divid{
margin:280px auto 0px 50px;
}
============================
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: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: 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;
}
============================
IE 6 and below
* html {}
IE 7 and below
*:first-child+html {}, * html {}
IE 7 only
*:first-child+html {}
IE 7 and modern browsers only
html>body {}
Modern browsers only (not IE 7)
html>/**/body {}
Recent Opera versions 9 and below
html:first-child {}
============================
"" ------ “”
>> ------ »
- ------- —
' ------- ’
& ------- &
============================
img { -ms-interpolation-mode: bicubic; } //scaling of the images
============================

============================
http://www.csszengarden.com/
http://www.meyerweb.com/
http://www.alistapart.com/
http://www.css3.info/
http://positioniseverything.net/
http://css-tricks.com/
http://cssmania.com/
http://cssremix.com/
http://www.css-website.com/
http://cssvault.com/
http://dezwozhere.com/links.html
http://www.w3schools.com/
============================

html>body {}
Modern browsers only (not IE 7)
html>/**/body {}
Recent Opera versions 9 and below
html:first-child {}

11 comments: