|
|
|
|
![]() ![]() |
May 8 2005, 12:49 AM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 8 Joined: 26-March 05 Member No.: 3,254 |
Here's the code I'm using for my javascript link I decided to add to a website I'm working on:
<li><a type="button" href="javascript: history.go(-1)">Go Back</a></li> The problem is that the css doesn't affect the javascript link. It displays as a plain blue underlined link. The stylesheet correctly renders regular links to other pages in the site, so the problem doesn't lie in my CSS coding. Thanks for the help. |
|
|
|
May 8 2005, 06:03 AM
Post
#2
|
|
|
Advanced Member Group: Members Posts: 140 Joined: 24-April 05 From: Australia Member No.: 4,289 |
Maybe you should add the style straight into the <A> code? Like <a type="button" href="javascript:history.go(-1)" style="color: ... ... ">. I don't quite understand the "button" bit.. If its meant to be a button, isn't it meant to be a button instead of underlined text? When I used the text link for "go back" on one of my sites some time back I believe the CSS had no problems with javascript.
|
|
|
|
May 8 2005, 09:15 AM
Post
#3
|
|
|
Premium Member Group: Members Posts: 208 Joined: 6-September 04 From: England Member No.: 315 |
normal hyperlinks reference:
CODE a:link, a:visited, a:active { color: #000000; font-weight: none; text-decoration: underline; } a:hover { color: #880000; text-decoration: none; } ---------------------------- i just tested it and it works fine for me. try adding this in the css page: CODE li a:link, li a:visited, li a:active { color: #000000; font-weight: none; text-decoration: underline; } li a:hover { color: #880000; text-decoration: none; } so if a link is within the <li></li> tags then it will be formatted to whatever you put into the code i have given above. what browser are you using? it works for me fine in IE and FF. |
|
|
|
May 8 2005, 11:08 AM
Post
#4
|
|
|
Member - Active Contributor Group: Members Posts: 92 Joined: 15-December 04 From: New Mexico Member No.: 1,759 |
QUOTE(rkosh @ May 7 2005, 05:49 PM) Here's the code I'm using for my javascript link I decided to add to a website I'm working on: <li><a type="button" href="javascript: history.go(-1)">Go Back</a></li> The problem is that the css doesn't affect the javascript link. It displays as a plain blue underlined link. The stylesheet correctly renders regular links to other pages in the site, so the problem doesn't lie in my CSS coding. Thanks for the help. You can also simply add a class property to your link: CSS Code: CODE a.whateverclass:link {color: #000066; text-decoration: none} a.whateverclass:visited {color: #000066; text-decoration: none} a.whateverclass:hover {color: #006600; text-decoration: underline} a.whateverclass:active {color: #FFFF00; text-decoration: none} Link Code: CODE <li><a type="button" href="javascript: history.go(-1)" class="whateverclass">Go Back</a></li> Hope This Helps, pete |
|
|
|
May 8 2005, 08:41 PM
Post
#5
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 8 Joined: 26-March 05 Member No.: 3,254 |
I'm such an idiot! I just realized I specified "type" instead of "class" on that link!!!. Thanks pbolduc!
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 8th September 2008 - 09:43 AM |