1.伪类选择器:
a:link{
属性:属性值
}
选择器有先后书写顺序
- :link 超链接点击之前⬇
- :visited 链接被访问过之后⬇
- :hover “悬停”:鼠标放到标签上的时候⬇
- :active “激活”: 鼠标点击标签,但是不松手时
2.文本对齐方式 | 样式
- list-style列表样式
- text-intend首行缩进(几个字符em单位)
3.普通选择器
-
子类
table tr td{ }
-
多选标签
p, a{ /*同时给p和a标签定义css属性*/ }
4.CSS引用方式:
-
外联式:
<link rel="stylesheet" href="css文件路径">
-
行内(嵌入)样式表
<table style="css样式"></table>
-
内嵌样式表
<style> a:hover { font-size: 50px; color: greenyellow; } </style>
5.css边框
border: width|style|color; //设置单个属性
border: width style color; //复合属性
1.border-top|right|bottom|left; //单独设置方向属性
2.boder-width|style|color
3.border-radious边框圆角
6.css盒子模型
- 组成:
- content
- padding内边距
- border边框
- margin外边距
7.css背景
background:<background-image>| <background-position>| <background-size>| <background-repeat>| <background-attachment>| <background-origin>| <background-clip>| <background-color>;
background-image: url(图片路径);
background-repeat背景图片平铺: no-repeat|repeat|repeat-x|repeat-y;
8.html5 内嵌内容
<!--HTML内联框架元素(<iframe>)表示嵌套的browsing context。它能够将另一个HTML页面嵌入到当前页面中。-->
举例:
<iframe src="https://www.lanmper.cn" name="frame"></iframe>
<a href="./dept.html" target="frame"></a>
target属性值===name属性值,实现页面跳转
name=“frame”>
target属性值===name属性值,实现页面跳转