|
|
|
|
Thread title: Links in css, want to make several different link-colors |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
04-22-2008, 06:14 PM
|
#1
|
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
Posts: 757
|
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
|
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
Posts: 86
|
.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
|
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
Posts: 757
|
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
|
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
Posts: 86
|
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
|
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
Posts: 757
|
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
|
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
Posts: 2,097
|
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
|
Status: Junior Member
Join date: Jan 2008
Location: Summit, New Jersey.
Expertise:
Software:
Posts: 86
|
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
|
Status: Member
Join date: May 2007
Location: US
Expertise:
Software:
Posts: 380
|
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
|
Status: Senior Member
Join date: Mar 2006
Location: Stockholm,Sweden
Expertise: Web Design, Coding
Software: Phoshop CS3
Posts: 757
|
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
|
Status: Member
Join date: Dec 2007
Location: Liverpool, UK
Expertise:
Software:
Posts: 287
|
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;
}
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
|
|