FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can't change link colors!





Da Rossa
Hi..
I'm having some difficulties. I can't change the link text color in my page. take a look at this: http://www.darossa.frih.net/notas
as you can see, the headers (first rows of the tables) have a link in a brown background. I'd like to change the link colors for all links, but I don't know where in the code I change the style.

I was about to paste the code in here, but there are annoying big blank spaces and would be so evil to be read. Please state the part of the code you'd like me to put in here.

Thanks in advance!
Peterssidan
It looks like you are using a lot of inline css which can be in the way. Better is to define your css inside a style tag or in an external file.

You can add this code inside the style tag after the title tag.
Code:
a:link {color: #123;}
a:visited {color: #123;}
a:active {color: #123;}
a:hover {color: #123;}

Change the color (#123) to what you want. This should affect all links but the inline css might override these settings.
Da Rossa
Gosh, I forgot to mention: I know very little of html (only the baaaasic tags) and absolutely nothing of css. All this design was thanks to NVU, I inserted the tables and made the alignments using the eye and the help of the "normal view" of the program. The skeleton of that code is based on this blog: http://rosseiro.blogspot.com, which I extracted the body style, the headings fonts, etc.
Peterssidan
ok, I should explain more. I didn't get that it was only the headers you wanted to change, sorry. I start all over with a different approach.

Find:
Code:
<td style="font-weight: bold; text-align: center; color: rgb(255, 255, 255); background-color: rgb(91, 46, 0); width: 200px;"><a href="http://www.darossa.frih.net/dir/dcv1/direito_civil1_geral.html">Direito
Civil</a></td>
This is the header cell containing the text "Direito Civil".

Code:
color: rgb(255, 255, 255)
is the color of the link. The numbers can be changed to get other colors. The numbers represents colors: rgb(red, green, blue). The mix between red, green and blue can create any color you want. You can also replace the rgb with a color on hexadecimal form if you like: (eg. rgb(40, 64, 255) can be replaced by #2840ff).

You will be able to create color codes in any graphics program or you can use an online tool like ColorPicker.

Find the other headers and change them the same way. the "background-color" is the background color of the cell. You can change this the same way as above if you like another background color.

This way of doing it makes the link the same color all the time. It's possible to change so that the color is a different when mouse is over it and so on, but I explain that only if you want to know.
Da Rossa
Yes, yes, actually I didn't explain myself precisely, but I have some knowledge about it Razz
The RGB for instance. The problem is that that color in this part:
Code:
color: rgb(255, 255, 255)

is actually the color of the text prior to the insertion of the link, that is blue. as you can see, the part "Direito Penal" is still white, that's because no link has been applied in there. When I do, the link color (0, 0, 255) will overide the text color, that is currently (255, 255, 255).

I'd like to put it in the color 153 51 0..
Smile
Peterssidan
I thought I tested that but apparently I didn't or tested the non link header.

Just add an style attribute to the link and set the color there
Code:
<a style="color: rgb(153, 51, 0);" href="http://www.darossa.frih.net/dir/dcv1/direito_civil1_geral.html">Direito Civil</a>
Da Rossa
Nice!!!! Take a look at http://www.darossa.frih.net/notas

But there is a hassle problem: do I have to put this style inside EACH of the link <a> tags? Can't I use something to overide all, since there are approx. 50 links?

Thanks!
Peterssidan
haha lol.. I thought it was only about the header cells d'oh!

No worry. We do like I was trying to say the first time.

find
Code:
<style type="text/css">
<!--
.style1 {font-family: Georgia, "Times New Roman", Times, serif}
-->
  </style>
replace with
Code:
<style type="text/css">
<!--
.style1 {font-family: Georgia, "Times New Roman", Times, serif}

a:link {color: rgb(153, 51, 0);}
a:visited {color: rgb(153, 51, 0);}
a:active {color: rgb(153, 51, 0);}
a:hover {color: rgb(153, 51, 0);}
-->
  </style>


In this way you will can change hover color and such if you want. Anyway, now all links should be the color you want but some of the links still are the wrong color. That's because they have the span with color attributes inside the <a> tag that overrides our color. You can change the color of the span or change so the span is on the outside of the <a> tag like the others. So it looks like this on one place:
Code:
<a href="http://www.darossa.frih.net/dir/ecp/epol_29-07-08.html"><span style="color: rgb(0, 0, 255);">terça, 29 de julho</span></a>
you can change it to
Code:
<span style="color: rgb(0, 0, 255);"><a href="http://www.darossa.frih.net/dir/ecp/epol_29-07-08.html">terça, 29 de julho</a></span>


I'm sure you can play with the colors and fix it like you want by yourself now. I hope so.. If there is more problem I help. but it starts to get tiresome. Wink
Da Rossa
Thanks sir!! Look at the result: http://www.darossa.frih.net/notas

Sorry for asking repeatedly about this basic thing!
Peterssidan
Nice! It works! Cool
Related topics
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.