CSS format: CSS format

Source: Internet
Author: User
Tags format define definition html tags
The previous section begins with a discussion of the basics of CSS (cascading style sheet).
Tell you there are three kinds of selector. However, only the HTML selector are described.
In this section, we'll introduce you to three kinds of details.
HTML Selector
Class selector:
ID selector:
HTML Selector
HTML selector is HTML tags, such as P, Div, TD and so on.
You define them in CSS, and in the whole page, the nature of this tag is based on your
The definition to show the. The syntax for HTML selector is as follows
tag {Property:value}
For example, the color we want to call H1 is red.
h1 {color:red}
Here is also a feature of CSS, which can define several selector
In a rule.
H1, H2, TD {Color:red}
This definition allows all H1, H2, and TD colors to be red.
Class Selector
Class selector has two types, one called related class selector, which is associated with a
HTML tag is related. Its syntax is
Tag.classname {Property:value}
For example, we want to call some, not all, H2 colors are red.

this is h2


this is red h2


The following is the program code

this is h2


this is red h2




The second type is independent class selector. It can be applied by any HTML tag.
Its syntax is as follows
. classname {Property:value}
If we have the following definition
. blueone {Color:blue} This article links http://www.cxybl.com/html/wyzz/CSS/20120601/27373.html

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.