Selector of style rules

Source: Internet
Author: User

Selector of style rules

HTML selector

Class selectorUsed to define a group of HTML elements with common functions or formats

ID selectorUsed to define a specific HTML element. JavaScript and CSS can manipulate and locate this specific HTML Tag based on this id value.

If you only need to set the format of a single element when a webpage is output on a certain media, you should use ID selector instead of inline style tables that directly set the style attribute of HTML elements.

After an embedded or linked style sheet is used in a webpage, You need to reset the corresponding style defined in the style sheet for the display effect of an element, inline style sheets are used to directly set the style attribute of HTML elements.

Association Selector

Combination Selector

For example, if the title in HTML uses the same style, you can combine the selector.

Pseudo element 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.