CSS Base Selector

Source: Internet
Author: User

1.html is responsible for the structure, CSS is responsible for the style, JS responsible behavior.

CSS is written in the head tag inside the container style tag inside,

<style type= "Text/css" >

body{

Background-color:pink;

}

</style>

2. Tag Selector: Use tag pairs in HTML as selectors

(1) All the tags can be used as selectors, such as Body,h1,ul,span and so on.

(2) No matter how deep the current label is, it can be selected.

(3) The choice is all, not one.

3. Class Selector

Wording: <p class= "xxx bbb" > Hahaha </p>

(1) The so-called class is the class attribute, and its properties can be reused.

(2) The same tag can carry multiple classes at the same time, but must be separated by a space (the use of classes, you can determine the level of a person's CSS)

4.ID Selector

(1) Any label can have a id,id name to start with a letter, can be underlined, numbers, uppercase and lowercase strict distinction.

(2) The ID on the same page cannot be duplicated, even if it is a different label.

(3) is the ID or class used? Generally used in CSS Class,id most are used in JS

CSS Base Selector

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.