How to create css styles?

CSS Syntax:

 

A CSS rule has two main parts: a selector, and one or more declarations. The following code is a CSS rule.

 

h1{color:red;front-size:12px;}

In the CSS code above:

 

h1 is the selector.

{color:red;front-size:12px;} is the declarations.

color is the property name

red is the property value

color:red; is called one declaration

Each declaration consists of a property and a value. selector selects the HTML element you want to style.

 

The property is the style attribute you want to change. Each property has a value. CSS declarations ends with a semicolon, and declaration groups are surrounded by curly brackets.

 

Here is another CSS to style . It changes the text color to red and makes the text align to center.

 

 

 

     

         

     

     

        Visit the website proanswers.org.com