CSS text font Color setting method (CSS color)

Source: Internet
Author: User
Tags border color
This article mainly introduces the CSS text font color setting method (CSS color), the need for friends can refer to the following

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 p CSS use 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 P tag
<p style= "color: #F00" >www.jb51.net</p>

2. Use the color style CSS code in the CSS selector:

. Pcss5{color: #00F}

/* Set object PCSS5 inside text is blue */

Extended reading: Here is a description of the style setting using CSS annotations, understanding the CSS annotations

3, P+css color style complete case:

CSS code:

Copy Code

The code is as follows:

. Pcss5{color: #00F}/* Set object pcss5 text in blue */

HTML code:

Copy Code

The code is as follows:

<p> use color CSS style <p style= "color: #F00" >www.jb51.net red </p> </p> <p> external style sheet set object color color <p class= "PCSS5" >www.jb51.net Blue </p> </p>

4. Example structure diagram:




Use the color color style and CSS code in the label above using color style.

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).

P+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



Of course, the general web development software has a color accessor:


Web development software DW software in CSS Color picker
How do I get CSS colors?
We can't remember the color values, and how do we 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.
Nine, p CSS color color style summary
set the object content color style using CSS styles, 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.