Jump to content

[SOLVED] CSS links


anatak

Recommended Posts

I am trying to change the colors of links but at this moment only hover works.

I don't see what is wrong with the CSS (otherwise I wouldn't be here) and I am puzzled why hover seems to work but the rest not

 

here is the CSS

a.bike:link{
color: #C0C0C0;
}

a.bike:visited{
color: #C0C0C0;
}

a.bike:hover{
color: #C0C0C0;
}
a.bike:active{
color: #C0C0C0;
}

 

and the html

<div id="main">

<table class="list_bike"><tr><th>Thumbnail</th><th>Brand</th><th>Model</th><th>Year</th>
						<th>Mileage</th><th>FrameNr</th><th>Price</th><th>Status</th></tr><tr><td><a href="single_bike_3.html"><img src="../picture/Ducati_3/thumb_ducati_3_0.jpg" /></a></td><td>Ducati</td>
					<td><a class="bike" href="single_bike_3.html">900 MHR</a></td>
					<td>1981</td><td>21000 km</td><td>DMZ860</td>

					<td>1300000 yen</td><td>For Sale</td></tr><tr><td>sorry no thumbnail</td><td>Ducati</td>
					<td><a class="bike" href="single_bike_1.html">900 SS</a></td>
					<td>1994</td><td>14000 km</td><td>ZDM900</td>
					<td>450000</td><td>For Sale</td></tr><tr><td><a href="single_bike_2.html"><img src="../picture/Ducati_2/thumb_ducati_2_0.jpg" /></a></td><td>Ducati</td>

					<td><a class="bike" href="single_bike_2.html">900 SS</a></td>
					<td>1976</td><td>13500</td><td>ZDM860</td>
					<td>2500000</td><td>Sold</td></tr><tr><td>sorry no thumbnail</td><td>Honda</td>
					<td><a class="bike" href="single_bike_4.html">NS 400 R</a></td>

					<td>1985</td><td>1200 km</td><td></td>
					<td>400000</td><td>For Sale</td></tr></table>
</div>

 

thanks for looking

anatak

Link to comment
Share on other sites

when I hover over the link it becomes silver #C0C0C0

 

when the link is shown in the page it is still blue

when the link has been clicked (visited) it is still blue

 

so basically only the hover state is showing the color I want. The other states are still on the default colors.

 

thx

Link to comment
Share on other sites

I threw that together on my side in a test and it seems to work fine.

 

The most common problem I have with css is order of style precedence.

 

Try this:

* Install "Web Developer" plugin for Firefox

* Go to "Tools" -> "Web Developer" -> "CSS" -> "View Style Information"

* Click on your Bike link

 

This should give you a window showing the CSS styles being applied to the link and the order it is applied in. You might find you have a conflicting style that is over-riding your custom styling (e.g.: global styling).

 

Post the result here if you still have problems.

 

 

Link to comment
Share on other sites

weird

now it works if I look at it on my server

I am looking at the page in firefox on a windows box and now it renders normally.

 

will try to figure out what is happening.

thanks for the web developer plug in. very handy.

Is there a way to turn of the web developer toolbar that you know ? (didn't look into options yet)

never mind the toolbar question I found that you can turn it of in firefox -> view -> toolbars

 

Link to comment
Share on other sites

sorry for the long time between replying

the problem is solved

I had an s somewhere in my css (probably from ctrl+s to save)

ran it through the css validator at w3 and that showed me the errors.

 

now everything works as it should be

thanks for all the help

 

for the interested here is the link to the validator at w3

both for your HTML and CSS files

 

http://www.w3schools.com/site/site_validate.asp#

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.