I 10 migliori hack per CSS
Forse potrebbe interessarti anche...
Se siete dei programmatori di siti web sicuramente date una certa importanza a creare del codice cross-browser, e del codice CSS e XHTML valido.
Sicuramente saprete anche quanto tempo si perde ogni volta in tutti quegli “hack” e “fix” per i vari browser!
Stylized Web ha creato una lista dei 10 hack e trucchi più utili che possono aiutare i programmatori di siti a salvare un po’ di tempo nella scrittura di codice…
1. Vertical align div
http://stylizedweb.com/2008/02/01/vertical-align-div/
2. Min-Height
selector {
min-height:500px;
height:auto; !important
height:500px;
}
3. PNG trasparenti
4. Autoclear
.container:after {
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.container {display: inline-table;}
/* Hides from IE-mac \*/
* html .container {height: 1%;}
.container {display: block;}
/* End hide from IE-mac */
5. Reset CSS
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,
fieldset,input,p,blockquote,th,td {
margin:0; padding:0;
}
table {border-collapse:collapse;border-spacing:0;}
fieldset,img {border:0;}
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;font-weight:normal;
}
ol,ul {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6 {font-size:100%;}
q:before,q:after {content:”;}
6. Scrolling Render Internet Explorer
html {
background : url(null) fixed no-repeat;
}
7. Opacità
#transdiv {
filter:alpha(opacity=75);
-moz-opacity:.75;
opacity:.75;
}
8. PRE Tag
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
9. LI: sfondo ripetuto in Internet Explorer
<!–[if lt IE 7]>
<style>
#leftnav li { zoom: 1;} /* haslayout=true */
</style>
<![endif]–>
10. Buono a sapersi…
@charset “UTF-8?;
/* ———————————————————————-
WinIE7
———————————————————————- */
*:first-child+html selector{property:value;}
/* ———————————————————————-
WinIE6 & Mac IE
———————————————————————- */
* html selector{property:value;}
/* ———————————————————————-
WinIE6
———————————————————————- */
/*\*/
* html selector{property:value;}
/**/
/* ———————————————————————-
MacIE
———————————————————————- */
/*\*//*/
selector{property:value;}
/**/




thanks for mentioning me
ps is this quick tags some plugin your using..?
You did a good job!
The quicktags feature is by a plugin: it’s here, n.12
Great, thank you
ottima selezione.
e capita proprio a fagiuolo credimi!
Thanks You
You are welcome!
Per fare in modo che Microsoft Internet Explorer – dalla versione 5 fino (attualmente) alla versione 8 – riconosca gli pseudo selettori disponibili in CSS3, esiste un hack che consiste in 2 file JS da includere nelle nostre pagine.
http://www.keithclark.co.uk/labs/ie-css3/
Internet migliore?
Un internet in cui i browser vedano alla stessa maniera i css senza bisogno di farsi venire mal di testa affinché possano essere visualizzati bene da tutte le piattaforme.
Viva gli standard w3c!