1、This is an oldie, but apperantly it is not as obvious as you would think.2.Sticky Footer (make footer always be on bottom without absolute positioning)id=mainclearfix3.5.footer6.7.*0;padding:8.html,body,#wrapheight:100%;9.bodyheight:min-height:10.#mainpadding-bottom:150px;/*mustbesameheightasthefoot
2、er*/11.#footer12.position:relative;13.margin-top:-150px;negativevalueof14.height:15.clear:both;16./*CLEARFIX*/17.clearfix:aftercontent:.;18.display:block;19.height:20.clear:21.visibility:hidden;22.clearfixdisplay:inline-block;23./*HidesfromIE-mac24.*html.clearfix1%;25.clearfix26./*EndhideAs of recen
3、tly i have had to use this over 50 times i think this is one of the most important tricks you will learn today.3.Cross-Browser Min Height1.element600px;autoimportant;You can replace the min-height and heigth with 12em or another value that works for you.4.Box Shadow (CSS3)1.boxbox-shadow:5px#666;-mo
4、z-box-shadow:-webkit-box-shadow:As you can see since this is a CSS3 property you will need all the three commands to make it cross browser(except for ie of course). The first 2 measurements are for horizontal offset and the vertical offset. The third number is for the blur radius. And the last is th
5、e color of the shadow.5.Text Shadow (CSS3) with IE hack1.texttext-shadow:1pxfilter:Shadow(Color=#666666,Direction=135,Strength=5);This technique is great for all modern browsers, the IE fix works but it is not amazing quality.6.Cross Browser CSS Opacity.transparent2./*ModernBrowsersopacity:0.7;3./*I
6、E8-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=70)4./*5-7alpha(opacity=70);5./*Netscape-moz-opacity:6./*Safari1-khtml-opacity:7.Opacity can be used for plenty of elements, it adds a certain new age style we all strive for.Notice that in some browsers transperancy is inherited by all ch
7、ild elements!7.The Famous Meyer Resethtml,div,span,applet,object,iframe,2.h1,h2,h3,h4,h5,h6,p,blockquote,pre,3.a,abbr,acronym,address,big,cite,code,4.del,dfn,em,font,img,ins,kbd,q,s,samp,5.small,strike,strong,sub,sup,tt,var,6.dl,dt,dd,ol,ul,li,7.fieldset,form,label,legend,8.table,caption,tbody,tfoot
8、,thead,tr,th,td9.margin:10.padding:11.border:12.outline:13.font-weight:inherit;14.font-style:15.font-size:16.font-family:17.vertical-align:baselinebaseline;18.19./*remembertodefinefocusstyles!20.:21.outline:22.23.body24.line-height:1;25.color:black;26.background:white;27.28.ol,ul29.list-style:none;3
9、0.31./*tablesstillneedcellspacing=0inmarkup32.table33.border-collapse:separate;34.border-spacing:35.36.caption,37.text-align:left;38.font-weight:normal;39.40.blockquote:before,blockquote:after,41.q:q:42.content:43.44.blockquote,q45.quotes:46.This is the most useful css reset out there, i use it for
10、almost everything I work on (even the 52framework, coming soon).8.Removing the dotted outlines1.a,a:activeoutline:I find myself getting very annoyed with the dotted outline (especially for text-indented elements that are off the page).9.Rounded Corners (non ie).element2.-moz-border-radius:5px;3.-web
11、kit-border-radius:4.border-radius:futureproofing5.6.element-top-left-corner7.-moz-border-radius-topleft:8.-webkit-border-top-left-radius:9.Love rounded corners? Dont want to slave over images and elements to get the effect? This is your solution, and elements still look fine in ie.10.Override Inline Styles.override2.font-size:14px3.This comes in handy plenty of times, I personally use it way too mucheverytime something doesnt work I test if its just not being applied because of some other style.
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2