Three Common style selector css in html: HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
This article mainly introduces how to use css in html. Generally, style control is implemented using class and id. However, jquery can be better controlled and is also a popular js framework. We recommend that you learn it. 1: Tag Selector

The tag selector is effective for all tags with certain labels. Take p as an example, that is, all the styles with p tags will look like this.


The Code is as follows:





P {font: ""; color: # FF0000}



What I'm doing now is the tag selector.


I also use the tag selector.


I have not been modified by any Selector


2: id SelectorNote that the id selector is unique because only id = "yy" has this style, and the Id of the element in a page must be unique... You know that the id selector starts with #. Its usage is: id = ""


The Code is as follows:





# Yy {font: ""; color: # FF0000}



What I'm showing now is the id Selector


I am not modified by the id Selector


I have not been modified by any Selector


3: class selectorThe class selector starts with a. And only the class = "" of the element can be expressed as this style. Its usage is: class = ""


The Code is as follows:





. Yy {font: ""; color: # FF0000}



What I'm showing now is the class selector


I have not been modified by the class selector


I have not been modified by any Selector

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.