2.在body区域,新建一个class为study的div
3.在style标签内,给study设置宽300px,高200px,粗细为1px的黑色边框
4.在浏览器中打开test.html,可以看到一个黑色边框的长方形
5.回到编辑器,在style标签内,将study的border属性后面的1px改成3px
6.再次在浏览器中打开test.html,会发现页面里长方形的边框变粗了!
css怎么增加边框没有间隙?
css增加边框没有间隙的方式如下
方法一:通用兄弟选择器( ~ )
Document
ul {margin: 0; padding: 0;}
li { list-style: none; height: 50px; line-height: 50px;}
li~li {border-top: 1px solid #000;}
1
2
3
4
5
6
li~li {…} 中的 ~ 符号称为通用兄弟选择器,匹配P元素之后的P元素,所以第一个P元素不会匹配到。
方法二:伪类选择器( :first-of-type / :last-of-type )
Document
ul {margin: 0; padding: 0;}
li { border-top: 1px solid #000; list-style: none; height: 50px; line-height: 50px;}
li:first-of-type {border-top: none;}
1
2
3
4
5
6
首先将所有 li 设置 border-top,然后用 :first-of-type 查找到第一个 li ,取消border-top。
radius是什么意思?
border-radius: 5px;代表设置一个半径为5px的圆角,5px可更换成理想的半径长度,一般使用在按钮边框或者DIV边框的圆角,使网页更灵动.
border属性怎样设置只有下边框有线?
border属性有四个值,分别是top,bottom,left,right属性,将其余三个值设置为none,bottom属性设置为1px。
如果觉得《border 边框变大 css边框右边框线怎么设置粗细 – CSS – 前端 根据以下的div代码编写一段css》对你有帮助,请点赞、收藏,并留下你的观点哦!