Page is a not externally linkable
rewboss - 8:30 am on Aug 15, 2002 (gmt 0)
A fairly common situation is where you have most text links behaving in one fashion, but the links in a navbar (which might be on a different background) doing something different. You can put all your navbar links in a <div> with an id "navbar", then your style sheet will look a little like this: /* First the styles for the "normal" links */ /* Now the styles for the navbar links */ Note: no comma after #navbar. #navbar a is interpreted as: "Any a element that is nested inside a div element with an id of 'navbar'." This allows you to drop the class attribute from the <a> tag: <div id="content"> <div id="navbar">
The possibilities are endless, actually. Class is the obvious solution (it's not a "workaround", this is how CSS is supposed to operate, despite what DW might tell you). Another elegant solution is the use of contextual selectors.
a:link { .... }
a:visited { .... } /* etc etc etc */
#navbar a:link { .... }
#navbar a:visited { .... } /* etc etc etc */
<a href="next.html">This will be a normal text link</a>
</div>
<a href="next.html">This will be a navbar link</a>
</div>