I am currently using the following code for back buttons on my site:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"java script: history.go(-1);">?back</a></td>
I am also using the following CSS in the head tag to avoid the underline text decoration of the link:
<style type="text/css"><!--
A { text-decoration:none }
--></STYLE>
On this particular web page I also have other linked text that I wanted other CSS to control. Is it possible to have the above CSS apply only to the back button code shown above and have different CSS apply to the rest of the links on the page?
Thanks,
DaveThat is what classes are for.
<head>
<style>
a {color: green}
.plain {text-decoration: none}
</style>
</head>
<body>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">a green link</a><br>
<a class="plain" href=http://www.webdeveloper.com/forum/archive/index.php/"#">a green link with no underline</a><br>
</body>You could also do something like this:
<style type="text/css">
div#menu {
width: 100px;
border: 2px solid #000;
background-color: #CCC;
}
div#menu a:link, div#menu a:visited {
color: #000;
text-decoration: none;
}
div#menu a:hover {
color: #999;
text-decoration: overline;
}
</style>
...
<div id="menu">
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">Home</a>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">About</a>
</div>
That way, only the links within the <div> with the id "menu" will be affected by those styles. Awesome. The classes worked to perfection. Thanks for the code.
-Dave
<a href=http://www.webdeveloper.com/forum/archive/index.php/"java script: history.go(-1);">?back</a></td>
I am also using the following CSS in the head tag to avoid the underline text decoration of the link:
<style type="text/css"><!--
A { text-decoration:none }
--></STYLE>
On this particular web page I also have other linked text that I wanted other CSS to control. Is it possible to have the above CSS apply only to the back button code shown above and have different CSS apply to the rest of the links on the page?
Thanks,
DaveThat is what classes are for.
<head>
<style>
a {color: green}
.plain {text-decoration: none}
</style>
</head>
<body>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">a green link</a><br>
<a class="plain" href=http://www.webdeveloper.com/forum/archive/index.php/"#">a green link with no underline</a><br>
</body>You could also do something like this:
<style type="text/css">
div#menu {
width: 100px;
border: 2px solid #000;
background-color: #CCC;
}
div#menu a:link, div#menu a:visited {
color: #000;
text-decoration: none;
}
div#menu a:hover {
color: #999;
text-decoration: overline;
}
</style>
...
<div id="menu">
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">Home</a>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">About</a>
</div>
That way, only the links within the <div> with the id "menu" will be affected by those styles. Awesome. The classes worked to perfection. Thanks for the code.
-Dave