今天还接着昨天的接着写,废话少说,直接上知识点
首先先对昨天的知识进行下补充
1.css选择器的优先级问题
important > 内联>id > class
注:important是用来设置最终的样式表的
2.border
今天在刷题的时候突然看到border的一个比较有意思的点:
border-radius:50%;
可以将图片设置成圆形环绕
然后就是今天的了
3.分组
在对元素进行布局时可以对多个选择器进行设置,每两个选择器/标签之间用逗号隔开
例子:h1,h2{font-size:16px; color:red;}
4.嵌套
p .name{text-align:center; text-decoration:none;}
5.定位(重点)
position属性值:
relative:相对于本身发生偏移
例子:
.one{
position:relative;
padding:5px;
width:100px;
border:1px solid red;
top:5px;
left:10px;
}
相对于原来的位置向下移动了5像素 向左移动了10px
absolute:相对于父类发生的偏移,如果没有父类那么就是相当于html。
例子:
<div class="one">
<ul cl