Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to set the border color of text box by html

Shulou Source: shulou.com Published: 2022-05-31 12:49:05 09月17日 Update

This article mainly introduces html how to set the border color of the text box related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this html how to set the border color of the text box article will have a harvest, let's take a look at it.

Html sets the border color of the text box by adding the border-color attribute to the text box and specifying the border color, such as [border-color:#ff0000 # 00ff00 # 0000ff;].

This article operating environment: windows10 system, html 5, thinkpad T480 computer.

It is actually very simple to set the border color of the text box. There is a special property border-color in css that sets the border color, and we can easily change the border color of the text box by using it. Let's take a look at this attribute together.

The border-color attribute is used to set the four border colors of an element.

For example:

Border-color: red, green, blue, pink

The upper frame is red.

The right border is green.

The bottom border is blue.

The left border is pink.

What are the attribute values?

Color specifies the background color. Find a complete list of color values in CSS color values

Transparent specifies that the color of the border should be transparent. This is the default.

Inherit specifies the color of the border, which should be inherited from the parent element

Code example:

(php.cn) p.one {border-style:solid; border-color:#0000ff;} p.two {border-style:solid; border-color:#ff0000 # 0000ff;} p.three {border-style:solid; border-color:#ff0000 # 00ff00 # 0000ff;} p.four {border-style:solid; border-color:#ff0000 # 00ff00 # 0000ff rgb (250J 0255);} One-colored border!

Two-colored border!

Three-colored border!

Four-colored border!

Note: the "border-color" attribute does not work if used alone. First use the "border-style" property to set borders. Exe.

Let's take a look at the running effect:

This is the end of the article on "how to set the border color of the text box in html". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to set the border color of the text box in html". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Color border text attributes knowledge element content article pink code value function right bottom easy to operate effect article method easy to understand more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info NVidia OPPO Reno macOS