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

2. Going Further, with Hypertext: Meetin... > Understanding attributes

Understanding attributes

Attributes give you a way to specify additional information about an element. While we haven’t looked at attributes in detail, you’ve already seen a few examples of them:

image with no caption
image with no caption

Let’s cook up an example to give you an even better feel for how attributes work:

What if <car> was an element?

If <car> was an element, then you’d naturally want to write some markup like this:

image with no caption

But this <car> element only gives a descriptive name for your car – it doesn’t tell us the make, precise model, whether it is a convertible, or a zillion other details we might want to know. So, if <car> were really an element, we might use attributes like this:

image with no caption

Better, right? Now this markup tells us a lot more information in an easy to write, convenient form.


  

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