https://zhidao.baidu.com/question/540248850.html

CSS去掉div的边框可以去掉css的border属性,或者覆盖border属性为none来实现。

1、如图,这是一个带边框的div测是页面

css去掉边框

2、第一个div的边框是这行css实现的效果

border: 5px solid black;

css去掉边框

3、第二个div没有设置边框样式

css去掉边框

4、第三个div的css设置了边框样式,但被内联样式覆盖为none,因此也能不显示边框。

css去掉边框

代码如下

<div class="box1"></div>

<div class="box2"></div>

<div class="box3" style="border: none;"></div>

div{

width:200px;

height:120px;

margin-bottom:10px;

background-color:yellow;

}

.box1, .box3{

border: 5px solid black;

}

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-12-10
  • 2021-11-29
  • 2021-05-01
  • 2022-12-23
猜你喜欢
  • 2022-02-27
  • 2022-02-14
  • 2022-02-15
  • 2022-01-04
  • 2021-08-10
  • 2022-12-23
相关资源
相似解决方案