How CSS text font color is set

Source: Internet
Author: User
Tags border 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

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.

Use color color styles within div tags

<div style= "color: #F00" >div</div>

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

. Div{color: #00F}

/* Set Object div inside text is blue */

DIV+CSS Color style Complete case:

CSS code:

. Div{color: #00F}/* Set object div Inside the text is blue */

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

Text color control like

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.

Page background color settings differences

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.

Set Border color differences

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

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.

RGB color gives one of four ways

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

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.


Believe that you have seen these cases you have mastered the method, more wonderful please pay attention to the PHP Chinese network other related articles!

Related reading:

How to use the transform gradient property in CSS3

Using CSS3 to optimize the HTML5 of the form

CSS3 a detailed description of the Translate property

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.