Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Can the hr tag in html be set to yellow?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article "html hr tags can be set yellow?" most people do not understand, so the editor summed up the following content, detailed, clear steps, with a certain reference value, I hope you can get something after reading this article, let's take a look at this "html hr tags can be set yellow" article it.

In HTML, the hr tag can be set to a yellow color by adding a color style using the style attribute of the hr tag. The border-color attribute is used to set the border color for the element.

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

The tag defines theme changes (such as topic shifts) in the HTML page and displays them as a horizontal line.

Elements are used to separate the content in the HTML page (or to define a change).

Default hr label style:

So can the hr tag be set to yellow?

The answer is: yes.

Let's introduce it through an example.

You can see that the color of the hr tag can be set using the border-color property of css.

The border-color property sets the four border colors of an element.

In css, color values can be written in four ways: color names, percentages, numbers, and hexadecimal values.

1) use color name

Although about 184 colors have been named, they are really supported by various browsers, and there are only 16 color names recommended by the CSS specification, as shown in the following table.

The color name recommended by the 1:CSS specification is color black pure black silver light gray navy light blue blue light blue green dark green lime light green teal indigo aqua sky blue maroon deep red red scarlet purple deep purple fuchsia magenta olive brown yellow yellow bright yellow gray deep gray white shell white

It is not recommended to use color names in web pages, especially on a large scale, to avoid some color names not being parsed by browsers or differences in the interpretation of colors by different browsers.

2) percentage of usage

This is one of the most common methods, such as:

Color: rgb (100%, 100%, 100%)

This declaration sets the red, blue, and green primary colors to the maximum, and the resulting combination is displayed as white. Instead, you can set rgb (0%, 0%, 0%) to black. The equality of the three percentile values will show gray, and in the same way, the larger percentile will be biased to the primary color.

3) use numeric values

The number range is from 0 to 255, for example:

Color: rgb (255,255,255)

The above declaration will show white, on the contrary, it can be set to rgb (0,0,0) and will show black. The equality of the three values will show gray, and in the same way, which value is larger and the proportion of the primary color will increase.

4) Hex color

This is the most commonly used color selection method, such as:

Color: # ffffff

Add a # color symbol before the hexadecimal. The above declaration will show white. Instead, you can set # 000000 to black and describe it as RGB:

Color: # RRGGBB

From 02555. in fact, decimal 255is equal to hexadecimal FF. One hexadecimal color value is equal to three sets of such hexadecimal values, which are connected in order to equate to red, blue, and green primary colors.

The above is about the content of this article on "can the hr tag in html be set yellow?", I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report