重置浏览器的默认值 ,然后重设浏览器的字体大小你可以使用雅虎的用户界面重置的CSS方案 ,如果你不想下载9MB的文件,代码如下:
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,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%; font-weight:normal; } q:before,q:after { content:”; } abbr,acronym { border:0; }
其次,我们重设浏览器字体的大小为10像素,使用如下:
html {font-size: 62.5%;}
这个大小基本合适,然后您可以根据自己的需要调整大小,如 标题1为120像素:
h1 {font-size: 2em;}
2.设置水平居中
大多数的网站目前都是固定宽度的。CSS代码如下:
div#container {margin: 0 auto;}
3.控制位置:绝对位置,相对位置
假如有两个div
查看更多关于常用CSS技巧资料收集_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did108774