I. Understanding CSS colors (CSS color)
Here is to introduce the page settings color contains what, page color specification.
1. Common color places include: Font color, hyperlink color, page background color, border color
2, color specification and Color rules: Web page using RGB mode color
Second, the color of the basic knowledge
The use of colors in Web pages is an essential element of a webpage. The purpose of the use of color is to have a different, dynamic (especially in the use of hyperlinks), aesthetics, and color is also a variety of web page style representation of one of the elements, understand CSS font color.
Traditional HTML color vs. css color comparison and div CSS application color
CSS Color Syntax:
Color: #000000;
RGB color VALUES (#FFFFFF, #000000, #F00) are directly added to the CSS style after color
RGB color values are determined at the actual layout and can be obtained using the Photoshop (PS) pickup tool.
Three or two ways to set the object color style
1. Use color color style within div tag
<div style= "color: #F00" >www.divcss5.com</div>
2. Use the color style CSS code in the CSS selector:
. Divcss5{color: #00F}/* Set object divcss5 text in blue */
Extended reading: Here, CSS annotations are used to describe this style setting, and to understand CSS annotations: http://www.divcss5.com/rumen/r32.shtml
3, Div+css color style complete case:
CSS code:
. Divcss5{color: #00F}/* Set object DIVCSS5 text in blue */
HTML code:
The <p> tag uses a color CSS style <br/> <div style= "color: #F00" >www.divcss5.com Red </div> </p> <p > external style Sheet Set object color color <br/> <div class= "divcss5" >www.divcss5.com Blue </div> </p>
4. Example structure diagram:
Four, the text color control the same
Traditional HTML and CSS text colors are the same using "color:" + "RGB color value", such as the color for the black word that corresponds to the Set CSS property selector add "color: #000;" Can.
Five, the page background color setting difference
The traditional setting background color uses "bgcolor= color value", while the CSS "background:" + color value. For example: Set the background to black, traditional HTML settings, that is, add "bgcolor=" #000 "" in the tag to achieve a black background, if in the corresponding CSS selector is always "background: #000" implementation.
Six, set the border color difference
Traditional "bordercolor= value", CSS "Border-color:" + color value. For example: in traditional HTML directly in the table tag to add "bordercolor=" #000 "", in the CSS now set "Border-color: #000;" You can make the border color black, while remembering to include setting the width and style (dashed, implemented).
Div+css color value Extension knowledge:
The color value is a keyword or an RGB specification for a number.
16 keywords are taken from the Windows VGA palette: Aqua, Black, blue, fuchsia, grey, green, grey, maroon, navy, olive, purple, red, silver, cyan, white, yellow.
Seven, RGB color gives one of four methods
1, #rrggbb (e.g., #00cc00) (it is strongly recommended to use this to indicate a color value)
2. #的RGB (e.g., #0c0)
3, RGB (10, x,x) x is an inclusive integer between 0 and 255 (such as RGB (0,204,0))
4, RGB (ÿ%,ÿ%,ÿ%), where Y is an inclusive number between 0.0 and 100.0 (such as RGB (0%,80%,0%))
Eight, the following is the RGB color table-TOP
Of course, the general web development software has a color accessor:
How do I get CSS color values?
We can't remember the color values, and how to determine exactly the same color values as the artwork? It's very simple. Usually we get accurate color values by using the Color Picker tool in PS software, and we can also use other specialized color tools to get the exact color value.
Ix. div CSS Color Style summary-TOP
Using CSS styles to set the object content color style, we can use the named CSS Class object to set its color style, as well as set the color style directly within the HTML tag. Above, we also introduce and practice these 2 kinds of text content set color method.