Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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

11. Divs and Spans: Advanced Web Constru... > Adding <span>s in three easy steps

Adding <span>s in three easy steps

<span> elements give you a way to logically separate inline content in the same way that <div>s allow you to create logical separation for block level content. To see how this works, we’re going to style the music recommendations by first adding <span> elements around the CDs and artists, and then we’ll write two CSS rules to style the <span>s. Here’s exactly what you’re going to do:

  1. You’re going to nest the CDs and artists in separate <span> elements.

  2. You’re going to add one <span> to the “cd” class and the other to the “artist” class.

  3. You’re going to create a rule to style the “cd” class with italic, and the “artist” class with bold.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial