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

Hide Focus

Ask your web developer friends how to remove those dotted lines around images, hyperlinks, and form buttons, and they’ll probably give you a snippet of JavaScript to do the job. The focus lines are there as a browser accessibility feature, but there may be instances where the lines are undesirable. Instead of relying on JavaScript to do the job, you can use a little-known attribute supported in Internet Explorer 5.5 and higher only. You can add hidefocus="true" to <a>, <input>, or <img> tags. The <area> tag is supposed to be supported, but it really isn’t—at least not in all my extensive testing. I did find that if you add the attribute to the <img> tag, that will work on image maps (<area> tags). A slight disadvantage to this method is that it is proprietary code, which means it won’t validate.

So what’s the best way to add this attribute in Dreamweaver? I’m glad you asked. I suggest you add the attribute to the tags you need it for in the Tag Library Editor. Then you’ll have the attribute available in the Attributes tab in Show List view. You’ll also have the attribute available as a code hint should you choose to hand-code it. If you’re unfamiliar with the Tag Library Editor, see the “Create Your Own Code Hints” tip in Chapter 9.

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