• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 2. Using CSS Rules > Using Multiple Declarations

Using Multiple Declarations

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

In this example, the <h1> and <h2> elements will be styled with a new declaration—color: navy;. The <h2> element also will be styled with text-align: center;, which will align it in the center of the browser window. The new declarations are highlighted in Listing 2.9. The results are shown in Figure 2.3.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint