CSS - Syntax

CSS Examples

CSS rule consists of two main parts: a selector, and one or more statements, for example:

h1 {color:blue; font-size:12px;}

Selector usually need to change the style of HTML elements.

Each statement consists of an attribute and a value.

Property is to set the style properties.

CSS declaration always ends with a semicolon, the statement of total Italian brackets, for example:

p {color:red;text-align:center;}

To make CSS more readable, we can describe each line of a property, for example:

p

{

color:red;

text-align:center;

}

CSS comments

Comments are used to explain the code, and can edit it, the browser will ignore it.

CSS comments begin with / * to * / end, for example:

/ * This is a comment * /

p

{

text-align: center; / * Font center alignment * /

color: black; / * Font Color Black * /

font-family:arial;/*arial字体*/

} 

  Author: Jeremy.Wu
  Source: https://www.cnblogs.com/jeremywucnblog/
  This article belongs to the author and blog Park total, welcome to reprint, but without the author's consent declared by this section must be retained, and given the apparent position of the article page the original connection, otherwise the right to pursue legal responsibilities.

Guess you like

Origin www.cnblogs.com/jeremywucnblog/p/12107363.html
Recommended