Home >Web Front-end >Front-end Q&A >How to set lower border in css

How to set lower border in css

藏色散人
藏色散人Original
2021-04-13 09:52:1820216browse

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.

How to set lower border in css

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.

How to set lower border in css

In the test.html file, use the div tag to create a module, and its lower border will be set below.

How to set lower border in css

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.

How to set lower border in css

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.

How to set lower border in css

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.

How to set lower border in css

Open the test.html file in the browser to check the effect.

How to set lower border in css

[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!

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