Link Attributes

admin

Administrator
Staff member
Can anyone tell me how to set the attribute for a text link ?<br />
<br />
I know I can do it using VLINK, ALINK, etc, within BODY tags, but is there a way of specifying the VLINK, ALINK, etc, for each link ??<br />
<br />
Can I use multiple BODY tags ?<!--content-->Hi there BurnCK,<br />
<br />
You may find the answers at w3schools (<!-- m --><a class="postlink" href="http://www.w3schools.com/css/css_pseudo_classes.asp">http://www.w3schools.com/css/css_pseudo_classes.asp</a><!-- m -->)<br />
<br />
coothead<!--content-->Originally posted by BurnCK <br />
Can I use multiple BODY tags ? <br />
No you cannot use more than one body tag. Your best bet for the links would be to use css.<!--content-->once you've set a style that includes what ever you want to do to your link<br />
e.g.<br />
<br />
.white {color: #FFFFFF;}<br />
<br />
then you can put it into each link that you want it to apply to<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"/page.html" class="white"><!--content-->The method above is a VERY poor way to do things!!!<br />
<br />
Assign a style directly to the links using your stylesheet, then you don't have to go around altering every single link! The style will apply to all links automatically.<br />
<br />
e.g.<br />
<br />
<br />
a:link {<br />
color: blue;<br />
}<br />
<br />
a:visited {<br />
color: blue;<br />
}<br />
<br />
a:hover {<br />
color: green;<br />
}<br />
<br />
a:active {color: red}<br />
<br />
you can set many other properties of the links if you like, such as background color, text-decoration to name but two.<br />
<br />
you can also set contextual styles so that a paragraph or table or div has it's links styled differently to the standard body link's style.<br />
<br />
#mainMenu a:link, #mainMenu a:visited{<br />
color: #0000ff;<br />
}<br />
<br />
#mainMenu a:hover, #mainMenu a:active{<br />
color: #0000ff;<br />
background-color: Yellow;<br />
border: 2px solid #000000;<br />
}<br />
<br />
Here links in the area/div/paragraph of id mainMenu have a style that differs to the rest of the document's links. If you needed several places withthis style,then you'd use a class instead of an id, as ids are supposed to be unique in a document page.<br />
<br />
If you use a class/id called currentPage and style it differently, to indicate to the user that this link takes you to this page you are currently one, e.g. greyed out, not underlined or whatever, you can apply that sytle to an individual link as shown above, which is it's only use.<!--content-->
 
Back
Top