Home  >  Article  >  Web Front-end  >  How to set borderless in css

How to set borderless in css

藏色散人
藏色散人Original
2021-04-12 15:33:287754browse

How to set borderless in css: first create an HTML sample file; then create a div with a border; finally, remove the border attribute of css or overwrite the border attribute to none to achieve the borderless effect.

How to set borderless in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

CSS To remove the border of a div, you can remove the border attribute of CSS, or overwrite the border attribute to none.

As shown in the picture, this is a div test page with a border.

How to set borderless in css

The border of the first div is the effect achieved by this line of css

border: 5px solid black;

How to set borderless in css

The second div is not set Border style

How to set borderless in css

The css of the third div sets the border style, but it is overridden by the inline style to none, so the border can not be displayed.

How to set borderless in css

The code is as follows

<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;
}

[Recommended learning: css video tutorial

The above is the detailed content of How to set borderless in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is css selectorNext article:what is css selector