Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
.textshadow{
textshadow:2px2px4px#666
}
#borderimagestyle{
borderwidth:15px
/*3typesofborderexistrepeated,roundedorstretched(repeat/
mozborderimage:url(border.png)3030stretch
webkitborderimage:url(border.png)3030stretch
}
boxshadow:0px3px3pxrgba(0,0,0,0.2)
mozboxshadow:0px3px3pxrgba(0,0,0,0.2)
webkitboxshadow:0px3px3pxrgba(0,0,0,0.2)
.round{
mozborderradius:10px
webkitborderradius:10px
borderradius:10px/*futureproofing*/
khtmlborderradius:10px/*foroldKonquerorbrowsers*/
}
#Bottom_Right{
height:65px
width:160px
mozborderradiusbottomright:50px
borderbottomrightradius:50px
}
#Bottom_Left{
height:65px
width:160px
mozborderradiusbottomleft:50px
borderbottomleftradius:50px
}
#Top_Right{
height:65px
width:160px
mozborderradiustopright:50px
bordertoprightradius:50px
}
#Top_Left{
height:65px
width:160px
mozborderradiustopleft:50px
bordertopleftradius:50px
}
background:webkitgradient(linear,lefttop,leftbottom,from(
background:mozlineargradient(top,#74b8d7,#437fbc)
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=
.pagebreak{
pagebreakbefore:always
}
.pullquote{
width:200px
float:right
margin:5px
fontfamily:Georgia,"TimesNewRoman",Times,serif
font:italicbold#ff0000
}
.wrapper{
width:960px
margin:auto
}
.container{
minheight:10em
display:tablecell
verticalalign:middle
}
#footer{
position:fixed
left:0px
bottom:0px
height:32px
width:100%
background:#333
}
/*IE6*/
*html#footer{
position:absolute
top:expression((0(footer.offsetHeight)+(document.documentElement.c
}
img{
background:url(loader.gif)norepeat50%50%
}
h1{
textindent:9999px
margin:0auto
width:400px
height:100px
background:transparenturl("images/logo.jpg")norepeat
}
p:firstletter{
display:block
margin:5px005px
float:left
color:#000
fontsize:60px
fontfamily:Georgia
}
.transparent{
filter:alpha(opacity=50)
mozopacity:0.5
khtmlopacity:0.5
opacity:0.5
}
Example:
<divclass="boxtransparent">Yourcontent</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*externallinks
The^=specifiesthatwewanttomatchlinksthatbeginwiththehttp:
*/
a[href^="http://"]{
paddingright:20px
background:url(external.gif)norepeatcenterright
}
/*emails
The^=specifiesthatwewanttomatchlinksthatbeginwiththemailt
*/
a[href^="mailto:"]{
paddingright:20px
background:url(email.png)norepeatcenterright
}
/*pdfs
The$=specifiesthatwewanttomatchlinkswhosehrefsendwith".pd
*/
a[href$=".pdf"]{
paddingright:20px
background:url(pdf.png)norepeatcenterright
}
/*zip
Sameasabovebutforzipfilesanditaddsaniconattherightofth
*/
a[href$=".zip"]:after{
content:url(icons/zip.png)
}
#resizeimage{
/*Justimaginethattheimage_1.pngis200x400px*/
background:url(image_1.png)topleftnorepeat
mozbackgroundsize:100px200px
obackgroundsize:100px200px
webkitbackgroundsize:100px200px
}
This lets you create multiple columns for your content without
needing to go through the formatting hassle of creating separate
paragraphs or whatnot. Change the number of columns to
however many you want. Vertical grey separator lines are
included, which you can change the color or remove altogether.
1
2
3
4
5
6
7
8
9
#columns3{
textalign:justify
mozcolumncount:3
mozcolumngap:12px
mozcolumnrule:1pxsolid#c4c8cc
webkitcolumncount:3
webkitcolumngap:12px
webkitcolumnrule:1pxsolid#c4c8cc
}
a{
display:block
background:url(sprite.png)norepeat
height:30px
width:250px
}
a:hover{
backgroundposition:030px
}
Bulletproof @fontface
This is the Fontspring @font-facesyntax:
1
2
@fontface{
fontfamily:'MyFontFamily'
3
4
5
6
7
src:url('myfontwebfont.eot?')format('eot'),
url('myfontwebfont.woff')format('woff'),
url('myfontwebfont.ttf')format('truetype'),
url('myfontwebfont.svg#svgFontName')format('svg'
}
<!Somespecialfonts>
/*Singlefontload*/
<linkrel="stylesheet"type="text/css"href="http://fonts.googleapis.co
/*Multiplefontload*/
<linkrel="stylesheet"type="text/css"href="http://fonts.googleapis.co
In your CSS:
1
2
3
body{
fontfamily:'DroidSerif',seriffontsize:48px
}
1
2
3
4
5
6
7
8
img.flip{
moztransform:scaleX(1)
otransform:scaleX(1)
webkittransform:scaleX(1)
transform:scaleX(1)
filter:FlipH
msfilter:"FlipH"
}
/*forfirefox,safari,chrome,andanyothergecko/webkitbrowser*/
webkittransform:rotate(90deg)
moztransform:rotate(90deg)
/*forie*/
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=
/*opera*/
otransform:rotate(30deg)
#content{
width:100%
margin:0
float:none
}
/*****SelectorHacks******/
/*IE6andbelow*/
*html#uno{color:red}
/*IE7*/
*:firstchild+html#dos{color:red}
/*IE7,FF,Saf,Opera*/
html>body#tres{color:red}
/*IE8,FF,Saf,Opera(EverythingbutIE6,7)*/
html>/**/body#cuatro{color:red}
/*Opera9.27andbelow,safari2*/
html:firstchild#cinco{color:red}
/*Safari23*/
html[xmlns*=""]body:lastchild#seis{color:red}
/*safari3+,chrome1+,opera9+,ff3.5+*/
body:nthoftype(1)#siete{color:red}
/*safari3+,chrome1+,opera9+,ff3.5+*/
body:firstoftype#ocho{color:red}
/*saf3+,chrome1+*/
@mediascreenand(webkitmindevicepixelratio:0){
#diez{color:red}
}
/*iPhone/mobilewebkit*/
@mediascreenand(maxdevicewidth:480px){
#veintiseis{color:red}
}
/*Safari23.1*/
html[xmlns*=""]:root#trece{color:red}
/*Safari23.1,Opera9.25*/
*|html[xmlns*=""]#catorce{color:red}
/*EverythingbutIE68*/
:root*>#quince{color:red}
/*IE7*/
*+html#dieciocho{color:red}
/*Firefoxonly.1+*/
#veinticuatro,x:mozanylink{color:red}
/*Firefox3.0+*/
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#veinticinco,x:mozanylink,x:default{color:red}
/*****AttributeHacks******/
/*IE6*/
#once{_color:blue}
/*IE6,IE7*/
#doce{*color:blue/*or#color:blue*/}
/*EverythingbutIE6*/
#diecisiete{color/**/:blue}
/*IE6,IE7,IE8*/
#diecinueve{color:blue\9}
/*IE7,IE8*/
#veinte{color/*\**/:blue\9}
/*IE6,IE7actsasan!important*/
#veintesiete{color:blue!ie}/*stringafter!canbeanything*/
/*IE8*/
#anotherone{color:blue\0/}/*mustgoattheENDofallrules*/
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
fontsize:100%
verticalalign:baseline
background:transparent
}
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
body{
lineheight:1
}
ol,ul{
liststyle:none
}
blockquote,q{
quotes:none
}
blockquote:before,blockquote:after,
q:before,q:after{
content:''
content:none
}
/*remembertodefinefocusstyles!*/
:focus{
outline:0
}
/*remembertohighlightinsertssomehow!*/
ins{
textdecoration:none
}
del{
textdecoration:linethrough
}
/*tablesstillneed'cellspacing="0"'inthemarkup*/
table{
bordercollapse:collapse
borderspacing:0
}
*{
color:black!important
backgroundcolor:white!important
backgroundimage:none!important
}
7
8
9
10
11
a:link{
fontweight:bold
textdecoration:underline
color:#06c
}
source: http://speckyboy.com/2011/04/15/25-css-snippets-for-some-of-the-most-common-and-frustratingtasks/