Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1011 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Links in css, want to make several different link-colors

Thread title: Links in css, want to make several different link-colors
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
04-22-2008, 06:14 PM
#1
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old  Links in css, want to make several different link-colors

Hey

I'm making a website for a class that I'm taking, and i ran into a problem today. I want to make several different colored links, but i don't know how to do it. My question is:

How do i make several different colored links (eg. one red, one blue without underlining, one green etc.) with css?

Thanks,
Jakob

04-22-2008, 06:32 PM
#2
Morgan is offline Morgan
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
 
Posts: 86
iTrader: 0 / 0%
 

Morgan is on a distinguished road

Send a message via AIM to Morgan Send a message via MSN to Morgan Send a message via Yahoo to Morgan

  Old

.Cyanide,

There's multiple ways to attain a multiple link style scheme.

A most common usage is IDs or classes.

For an example, we'll use IDs.

Code:
#navigation a:link, a:visited, a:active {
color: #000000;
text-decoration: none;
}
#navigation a:hover {
color: #000000;
text-decoration: underline;
}

#content a:link, a:visited, a:active {
color: #FFFFFF;
text-decoration: none;
}
#content a:hover {
color: #FFFFFF;
text-decoration: underline;
}
From there, within your wrapper, id="navigation" or id="content".

I hope this helps.

04-22-2008, 07:13 PM
#3
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old

I want to change the border of my image from dark grey to white when hovering over the image. Your code didn't seem to work for that =/

04-22-2008, 07:20 PM
#4
Morgan is offline Morgan
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
 
Posts: 86
iTrader: 0 / 0%
 

Morgan is on a distinguished road

Send a message via AIM to Morgan Send a message via MSN to Morgan Send a message via Yahoo to Morgan

  Old

Well, you didn't specify that. All you asked about was a link.

border: 1px solid #HEX;

Change the hex code per ID.

04-22-2008, 07:26 PM
#5
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old

didn't work either =/ I think there's something wrong with that code cos when i change it to "border: 1px solid #000000;" all the links in the menu goes crazy, they shouldn't do that when they don't even have the same class.

04-22-2008, 07:54 PM
#6
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Try using

Code:
a .class{
bla: bla;
}
or if you use an id

Code:
a #class{
bla: bla;
}

04-22-2008, 08:05 PM
#7
Morgan is offline Morgan
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
 
Posts: 86
iTrader: 0 / 0%
 

Morgan is on a distinguished road

Send a message via AIM to Morgan Send a message via MSN to Morgan Send a message via Yahoo to Morgan

  Old

You can break it up, if needed, as well.

Have seperate styling for your <img> tag, and keep the above link styles.

04-22-2008, 08:32 PM
#8
Gurnk is offline Gurnk
Status: Member
Join date: May 2007
Location: US
Expertise:
Software:
 
Posts: 380
iTrader: 12 / 100%
 

Gurnk is on a distinguished road

Send a message via AIM to Gurnk Send a message via MSN to Gurnk

  Old

You need to do it like

a.red:link, a.red:active, a.red:visited { // attributes }
a.red:hover { // attributes }

Then your HTML would be

<a href="#" class="red">Link</a>

04-23-2008, 04:18 PM
#9
.Cyanide is offline .Cyanide
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
 
Posts: 757
iTrader: 4 / 100%
 

.Cyanide is an unknown quantity at this point

Send a message via MSN to .Cyanide

  Old

This is my html code for the image tag (i have several images with the same class):

<td><a href="http://www.jakobgrannas.com/portfolio/Client%20work/Asian%20dating/homepage%20copy.png" class="bildlink"><img src="thumbs/asiandating.jpg" width="70" height="70" class="thumbsleft" alt="" border="1"></a></td>

And this is my css:

a.bildlink:link {
border-color: #c0d02f;

}

a.bildlink:visited {
border-color: #c0d02f;

}

a.bildlink:active {
border-color: #c0d02f;

}

a.bildlink:hover {
border-color: #727272;

}

04-23-2008, 04:26 PM
#10
Liam is offline Liam
Liam's Avatar
Status: Member
Join date: Dec 2007
Location: Liverpool, UK
Expertise:
Software:
 
Posts: 287
iTrader: 0 / 0%
 

Liam is on a distinguished road

Send a message via MSN to Liam

  Old

try this

<td class="bildlink"><a href="http://www.jakobgrannas.com/portfolio/Client%20work/Asian%20dating/homepage%20copy.png"><img src="thumbs/asiandating.jpg" width="70" height="70" alt="" class="thumbsleft"></a></td>

.bildlink a {
border:1px solid #color;
}

.bildlink a:hover {
border:1px solid #hovercolor;
}

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed