Home >Web Front-end >HTML Tutorial >CSS Language Notes<1>_html/css_WEB-ITnose

CSS Language Notes<1>_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:46:531086browse

CSS (Cascading Style Sheets) Chinese: Cascading Style Sheets

Defined syntax:97f5157725a81b911876997d1aa52872 531ac245ce3e4fe3d50054a55f265927

Example:

<style type="text/css">a{  color:red;  text-align:center;  font-size:24px; }</style>

Selector

id selector

HTML tag attributes use id to set the selector, and use "#" to select in CSS.

For example: 49c363130f1f5301d554d0cb975f570eA piece of text5db79b134e9f6b82c0b36e0489ee08ed

The following is the method of selecting the representation.
Example:

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

class selector

If it is a class selector, it is written with a "." symbol, and the id selector The difference is that the class selector can be used in multiple HTML tags.

For example:55e10b172b3cf299bf1ad8db61b05640a paragraph of text5db79b134e9f6b82c0b36e0489ee08ed

e7a0e57f6971152ba9f7f500b69da693a paragraph of text94b3e26ee717c64999d7867364b1b4a3

Example:

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

The second way of writing represents the qqq element under the a tag

<style type="text/css">a.qqq{   color:red;   text-align:center;   font-size:24px;       }</style>

multiple elements Selector

Example:

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

Descendant element selector

selects the li element under a in the instance. Descendant elements are selected with spaces. .

Example:

<style type="text/css">.a li{       color:red;      }</style>

Child element selector

Child element is the same element under class, parent-child relationship. Use the greater than sign to represent

Example:

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

Summary

ID is unique and class is versatile.

To be continued.............

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn