css样式:
在外部新建一个css样式,在网页文件中添加:
<link rel=”StyleSheet”type=”text/css” href=”style.css”>
css之字体相关属性:
字体大小:font-size:”2px” (“2%” “smaller” ”larger” ):相对于父窗口
字体样式:font-family:”微软雅黑,宋体“(当浏览器无法显示第一个,则再显示第二个)
字体厚度:font-weight:”normal” “bold” “bolder” “lighter” “100-900”
字体样式:font-style: normal 斜体:italic 倾斜:oblique
字母变大写:font-variant:small-caps;输入的小写字母变成大写
css之背景相关属性:
背景颜色:background-color:red
背景图片:background-image:url(‘xxx’)
背景重复:background-repeat: (repeat-x repeat-y)等价于repeat no-repeat
背景位置(横向,纵向):background-position: left top
center center
right bottom
20px 20px
总结:以上背景属性归一 background:#f60 url(‘xxx’) no-repeat top center