Get the App
SLTechnology News&Howtos  ›  Development  › 

How css uses the border Border property

Shulou Source: shulou.com Published: 2022-06-03 11:01:19 10月05日 Update

This article is about how css uses the border border property. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The CSS border, or CSSborder, is the style CSS property that controls the width, color, dashed lines, solid lines, and so on, of the border lines of the control object.

CSSborder browser support

IE Firefox Chrome Safari Opera

The border-color property is supported by all browsers.

Note: InternetExplorer6 (and earlier versions) does not support the attribute value "transparent".

Note: the value "inherit" is not supported by IE7 and earlier browsers. IE8 needs! DOCTYPE. IE9 supports "inherit".

Definition and usage of CSSborder

The border-color property sets the color of the four borders. This property can be set to 1 to 4 colors.

The border-color attribute is an abbreviated attribute that sets the color of visible parts of all borders of an element, or sets different colors for each of the four edges. Take a look at the following example:

Example 1

Border-color:redgreenbluepink

The upper frame is red.

The right border is green.

The bottom border is blue.

The left border is pink.

Example 2

Border-color:redgreenblue

The upper frame is red.

The right and left borders are green

The bottom border is blue.

Example 3

Border-color:dottedredgreen

The top and bottom borders are red.

The right and left borders are green

Example 4

Border-color:red

All four borders are red.

Keep in mind that the style of the border cannot be none or hidden, otherwise the border will not appear.

Note: always declare the border-style attribute before the border-color attribute. The element must get a border before you change its color.

Default value: notspecified

Inheritance: no

Version: CSS1

JavaScript syntax: object.style.borderColor= "# FF0000blue"

Possible value

Value description

Color_name specifies that the color value is the border color of the color name (such as red).

Hex_number specifies a border color with a color value of hexadecimal value (for example, # ff0000).

Rgb_number specifies that the color value is the border color of the rgb code (for example, rgb (255p0)).

Transparent default value. The border color is transparent.

Inherit states that the border color should be inherited from the parent element.

Thank you for reading! This is the end of this article on "how css uses border border properties". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Borders colors attributes examples support red elements right comments browsers versions green browsing content more styles articles blue settable different Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Microsoft vpn Docker Xiaomi