Jump to content
xisto Community
Sign in to follow this  
rkosh

Javascript Disables Css Link?

Recommended Posts

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="java script: 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.

Share this post


Link to post
Share on other sites

Maybe you should add the style straight into the <A> code? Like <a type="button" href="java script: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.

Share this post


Link to post
Share on other sites

normal hyperlinks reference:

a:link, a:visited, a:active {[tab][/tab]color: #000000;[tab][/tab]font-weight: none;[tab][/tab]text-decoration: underline;}a:hover {[tab][/tab]color: #880000;[tab][/tab]text-decoration: none;}

----------------------------

i just tested it and it works fine for me. try adding this in the css page:

li a:link, li a:visited, li a:active {[tab][/tab]color: #000000;[tab][/tab]font-weight: none;[tab][/tab]text-decoration: underline;}li a:hover {[tab][/tab]color: #880000;[tab][/tab]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.

Share this post


Link to post
Share on other sites

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="java script: 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.

<{POST_SNAPBACK}>


You can also simply add a class property to your link:

 

CSS 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:

<li><a type="button" href="javascript: history.go(-1)" class="whateverclass">Go Back</a></li>

Hope This Helps,

pete :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.