html colour problems!

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

html colour problems!

Post by Joe »

This is really an html question but these are my favourite forums and I thought it would be the best place to ask. I am making a who's online script where administrators/developers have a link colour of red while normal users have a link color of blue. The only way I know to change a link colour is:

<BODY BGCOLOR="#FFFFFF" TEXT="black" LINK=red VLINK=red ALINK=red>

but you can only use the <body> tag once which prevents me from using 2 seperate link colours. Is there any way to bypass this problem. If so, please help ;)


Regards




Joe 8)
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

how about using css?
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Ha well I am totally clueless to how CSS works. Any other suggestions!
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

you can have you link and use the font tag like this

Code: Select all

<a href=blah.html><font color=blah>asdfasdfadf</font></a>
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

Joe wrote:Ha well I am totally clueless to how CSS works. Any other suggestions!
mate you gotta have a clue about CSS, it rocks!!!

There are CSS editors, and i think you can start with them easily.

TopStyle Editor for example.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

.whosOnline .administrator a,
&#123;
  color: #red;
&#125;

.whosOnline .developer a
&#123;
  color: #red;
&#125;

.whosOnline .user a
&#123;
  color: #blue;
&#125;

Code: Select all

<span class="whosOnline"><span class="administrator"><a href="whatever">admin</a></span> <span class="developer"><a href="whatever">dev</a></span> <span class="user"><a href="whatever">user</a></span>
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

i do like css but in this case i think the good ol' font tag is the easiest way....
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Hey thanks a lot guys all worked well. Hey mudkicker. I have no intentions to start CSS at the moment as I am very busy with my PHP + mysql studies but I will keep your word and learn it as soon as I can. Thanks!

Due to me knowing no CSS at all I decided to use dull1554's method. Thanks a lot man.


Joe
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

feyd wrote:

Code: Select all

.whosOnline .administrator a,
&#123;
  color: #red;
&#125;

.whosOnline .developer a
&#123;
  color: #red;
&#125;

.whosOnline .user a
&#123;
  color: #blue;
&#125;

Code: Select all

<span class="whosOnline"><span class="administrator"><a href="whatever">admin</a></span> <span class="developer"><a href="whatever">dev</a></span> <span class="user"><a href="whatever">user</a></span>
??

Code: Select all

.a link&#123;color:#red;&#125;
.b link&#123;color:#blue;&#125;

Code: Select all

<a href="link" class="a">Administrator!</a><a href="link" class="a">Developer!</a><a href="link2" class="b">Member!</a>
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

I have to recommend that you learn CSS as soon as you have time. It was the sweetest discovery I made after I started making websites.
Everything to do with colors, layout, and design became much, MUCH easier and accurate.
It's worth it.
Post Reply