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

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.