In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to set the background color for html. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
One: set the background color
1. Prepare to edit HTML
First determine the background color to use, and the HTML color is determined by each code. By accessing http://www.php.cn/html/html-colornames.html in your computer's Web browser, you can view the codes for all colors and select the base color to use in the "HEX" section.
two。 Use Notepad + + or Notepad to open the HTML file and add all the style information for the page, including the background color. Add the background-color attribute to the body element. Background-color to enter between body parentheses, as follows:
one
Red background
Or
one
two
three
Body {
Background-color:red
}
3. You can use "background-color" to define the background of other elements, such as headings, paragraphs, etc. For example, to apply a background color to the main title () or paragraph (
).
Two: create a gradient background
1. When making a gradient, we need two pieces of information: the starting point and the angle, as well as the color of the transition between the gradients. You can select multiple colors to make the gradient move between all colors, and you can set the direction or angle of the gradient.
Attributes:
Background: linear gradient (direction / angle, color 1, color 2, color 3, etc.)
two。 When you make a vertical gradient, if you do not specify a direction, the gradient will create a gradient from top to bottom, adding the following code between the markers:
one
two
three
four
five
six
seven
eight
nine
ten
Html {
Min-height: 100%
}
Body {
Background:-webkit-linear-gradient (left, # 93B874, # C9DCB9)
Background:-o-linear-gradient (right,#93B874, # C9DCB9)
Background:-moz-linear-gradient (right,#93B874, # C9DCB9)
Background: linear gradient (to the right, # 93B874, # C9DCB9)
Background-color: # 93B874
}
Of course, you can also add orientation to the gradient to change the way the color offset is displayed. You can not only add more than two colors, but also add a percentage after each color. You can also set the desired spacing for each color segment, add transparency to your color, and use the same color to fade from color to empty. You can also use the rgba () function to define the color, and the end value determines the transparency: 0 solid and 1 transparent.
This is the end of this article on "how to set background color in html". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.