CSS学习笔记[3]——CSS常见样式[上]

2018-01-27  本文已影响0人  一颗奋发向上的蛋

块级元素和行内元素

block-level

div h1~6 p hr form
ul dl ol pre table
li dd dt tr td th

inline-level

em strong span a br img
button input lable select textarea
code script

宽高

只对块级元素生效,对行内元素设置无效

边框

border-width
border-color
border-style

边距

padding
margin

display

inline | block | list-item | inline-block | table | none | inherit

font

font-size
font-family
font-weight
line-height
// 以上属性都可以继承给子元素
font: 12px/1.5 tahoma,arial; //1.5是line-height

浏览器默认字体大小16px;中文版chrome最小字体12px

文本

颜色

单位

width: 50% ; //相对父宽度
上一篇 下一篇

猜你喜欢

热点阅读