Home > Article > Web Front-end > How to set lower border in css
How to set the bottom border in css: first create a new HTML file; then use the div tag to create a module; then add an id attribute to the div tag; finally use the border-bottom attribute to set the bottom border of the div.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Create a new html file, named test.html, to explain how to use CSS to display only the lower border of a div.
In the test.html file, use the div tag to create a module, and its lower border will be set below.
In the test.html file, add an id attribute to the div tag, which will be used to set the style of the div using the id below.
In the css tag, set the style of the div through the id, define its width as 100px, height as 100px, and background color as gray.
In the css tag, use the border-bottom attribute to set the bottom border of the div. For example, set it to a 2px wide red border.
Open the test.html file in the browser to check the effect.
[Recommended learning: css video tutorial]
The above is the detailed content of How to set lower border in css. For more information, please follow other related articles on the PHP Chinese website!