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

WBOY
Release: 2022-05-17 11:06:54
Original
3349 people have browsed it

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>
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!