CSS, How to use Multiple Declarations?

More than one declaration can be used within a declaration block. Each declaration must be separated with a semicolon.

In this CSS, How To Tutorial the h1 and h2 elements will be styled with a new declaration. {color: navy;} The h2 element will also be styled with {text-align: center;} which will align it in the center of the browser window.

HTML Code

<h1> CSS Headings One</h1>
<h2> CSS Heading Two</h2>
<p> Some text about your css tutorial would go here</p>

CSS Code

h1 {
text-align: center;
color: navy;
}
h2 {
font-style: italic;
text-align: center;
color: navy;
}

Helpful Articles

Diabetic Renal Diet for CKD Patients Diet

Diabetic Renal Diet Guidelines Made Easy! Being that one of the most common extrarenal diseases affecting the kidney is diabetes mellitus, diabetic renal diet has become a topic of interest nowadays...

The Lemonade Diet

There are many people who have the primary goal of weight loss and they turn to the lemonade diet to lose weight quickly...

How Nutrition Affects Your Dog’s Behavior

A very important aspect in owning and taking care of a pet dog is providing the animal with good nutrition and proper nourishment...

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • email
  • Fark
  • LinkaGoGo
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati
  • Twitter
  • Propeller
  • Yahoo! Buzz

Tags: , , ,

Leave a Reply