第17天:CSS引入、选择器优先级,中级

一、CSS 位置

1、行内式 css

<div class="fr" >aa</div>

2、 内嵌式样式

<style>

.one {

width: 200px;

}

</style>

3、外链式

<link rel=”stylesheet” href =”css/base.css” />

二、Font 字体综合写

Font: 字体加粗 字号/行高 字体;

必须有字号和字体。

Font-weight:bold; 700

S del 删除线

I em 倾斜

U ins 下划线

字体加粗 font-weight: 700;

让字体不加粗: font-weight:normal;

字体倾斜: font-style:italic; 不用

字体不倾斜: font-style:normal;

不下划线 不删除线: text-decoration: none;

定位: position:static; 静态定位 约等于标准流

浮动的不浮动: float:none; none left right

定位的不定位: position: static; absolute relative fixed

三、选择器的优先级

标签 (1) < 类(10 ) < id(100 ) < 行内(1000)

网页稳定:

Width 和height 最稳定

其次 padding

最后才考虑margin