网站CSS通用写法一般怎么写?

html-css015

网站CSS通用写法一般怎么写?,第1张

我一般是这样写

/*reset style*/

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td { margin:0padding:0}

body { width:100%height:100%background:#FFFcolor:#333font:12px/1.5em Arial, Helvetica, sans-serifposition:relativeleft:0top:0}

h1, h2, h3, h4, h5, h6 { font-size:1em}

*{ word-wrap: break-word}

a, a:hover { color:#333text-decoration:none}

a:hover { color:#c00}

fieldset, img { border:none}

img{ border:0vertical-align:middle}

legend { display:none}

ol, ul, li { list-style:none}

em, strong, cite, th { font-style:normalfont-weight:400}

input, textarea, select, button { font:12px Verdana, Helvetica, Arial, sans-serif}

table { border-collapse:collapse}

html { overflow:-moz-scrollbars-vertical}

/* common style */

.clearfix:after { content:"."display:blockheight:0clear:bothvisibility:hidden}

.clearfix { display:inline-block}

/*\*/ .clearfix { display:block} /**/

.cl{ clear:both}

把它写在一个css文件里 存起来 然后直接调用 我每次写都是这样用的

html标签的属性与css里的属性不是通用的。

html 指超文本标签语言,而css用于控制网页的样式和布局。

html与css属于两种不同的东西,所以它们有自己的独自的属性。

html与css部分属性的名称可能一致,比如html中table有属性width=20,而css中也有width:20px但是不要混淆。