Home > Article > Web Front-end > How to set the top border in css so that it does not appear
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;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
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:
(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!