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

Lesson 2. Upgrading to XHTML > Closing Empty Tags That Have Attributes

Closing Empty Tags That Have Attributes

Earlier in the lesson, you easily closed the empty tags that lack attributes; for example, you had Dreamweaver find <br> and replace it with <br />. But closing empty tags that have attributes is a different story. That is, closing off <img src="images/image.gif" width="200" height="150"> poses the same challenge that the <font> tag did: the differing attributes and their values make the tags harder to search for.

As with the <font> tag, Dreamweaver can write the regular expressions needed to successfully find all of the <img> tags. You have it do so by choosing Specific Tag and by picking img from the HTML Tag List drop-down menu. Unfortunately, there is no “Close Empty Tag in XHTML Style” action in the Find and Replace dialog, which means that the finding is going to be easier than the replacing. Still, there is a workaround, which, if somewhat ugly, gets the job done.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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