Home >Web Front-end >Front-end Q&A >How to set the top border in css so that it does not appear

How to set the top border in css so that it does not appear

WBOY
WBOYOriginal
2022-04-18 15:50:143401browse

In CSS, you can use the "border-top" attribute to set the top border not to be displayed. This attribute is used to set the width, style and color of the upper border of the element. When the value of the attribute is set to 0, none or transparent , the top border will not be displayed, and the syntax is "element {border-top: attribute value;}".

How to set the top border in css so that it does not appear

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to set the top border in css so that it is not displayed

border-top abbreviation attribute sets all the properties of the top border into one statement

You can set the following properties in order: border-top-width, border-top-style, and border-top-color.

If you don’t set one of the values, there will be no problem, such as border-top:solid #ff0000; as well Allowed.

  • border-top-width specifies the width of the top border.

  • border-top-style Specifies the style of the top border.

  • border-top-color Specifies the color of the top border.

The example is as follows:

<html>
<head>
<style type="text/css">
p 
{
border-style:solid;
border-top:none;
}
</style>
</head>
<body>
<p>这个段落没有上边框</p>
</body>
</html>

Output result:

How to set the top border in css so that it does not appear

(Learning video sharing: css video tutorial)

The above is the detailed content of How to set the top border in css so that it does not appear. 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