CSS language Notes < a >

Source: Internet
Author: User

CSS (cascading style Sheets) Chinese: Cascading style sheet set to syntax: <style type= "" > </style>

Instance:

<style type= "Text/css" >a{ color:red;  Text-align:Center; font-size:24px; }</style>
Selector ID Selector

The HTML tag attribute is set by the ID of the selector, in the CSS is "#" to select.

such as: <a id= "A" > a text </a>

The following is the method for the selected representation.
Instance:

<style type= "Text/css" > #a { color:red; text-align:Center; font-size:24px;    } </style>
Class Selector

If you are using the class selector, the notation is "." Number, unlike the ID selector, the class selector can be used in multiple HTML tags.

such as: <a class= "QQQ" > a text </a>

<p class= "QQQ" > A paragraph of text </p>

Instance:

<style type= "Text/css" >.QQQ {   color:red;    text-align:Center;    font-size:24px;        } </style>

The second type of notation

<style type= "Text/css" >A.QQQ {   color:red;    text-align:Center;    font-size:24px;       } </style>
Multi-Element Selector

Instance:

<style type= "Text/css" >a,b,c,d {        color:#FFFFFF;         text-align:Center;         font-size:24px;        } </style>
Descendant element Selector

Select the Li element under a in the instance, and the descendant elements are selected with a space.

Instance:

<style type= "text/css" >.a Li {       color:red;      } </style>
Child element Selector

The child element is the same element under class, the parent-child relationship. denoted by greater than sign

Instance:

<style type= "Text/css" >.a >. Title {                color:#FF6300               }</style>

Summarize

ID is unique and class is multi-purpose.

Cond.............

CSS language Notes < a >

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.