Home > Article > Web Front-end > CSS Language Notes<1>_html/css_WEB-ITnose
CSS (Cascading Style Sheets) Chinese: Cascading Style Sheets
Example:
<style type="text/css">a{ color:red; text-align:center; font-size:24px; }</style>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>
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>
Example:
<style type="text/css">a,b,c,d{ color:#FFFFFF; text-align:center; font-size:24px; }</style>
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 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>
ID is unique and class is versatile.
To be continued.............