There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Altering link styles on page.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
pandapete's Avatar
Member with 40 posts.
 
Join Date: Aug 2006
Location: Cairns, Australia
Experience: Learning every day
01-Nov-2006, 07:57 PM #1
Altering link styles on page.
Hello everyone again.

Another problem with CSS I'm afraid.

I am trying to have different CSS values for my a links. That is, I want some links in 1 area of a page to look like 1 thing, and other links in another section of the page to look differently.

I have looked at some stylesheets that have this happening, but for some reason it is not working for me.

Here is the CSS code I am using.
Code:
a:link {
	font-family: Tahoma;
	font-size: 11px;
	color: #999999;
	text-decoration: none;
}

a:visited {
	font-family: Tahoma;
	font-size: 11px;
	color: #999999;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.mainText {
	color: #999999;
	font-family: Arial, Tahoma, sans serif;
	font-size: 12px;
	text-decoration: none;
}

a.mainText {
	color: navy;
	font-family: Arial, Tahoma, sans serif;
	font-size: 12px;
	text-decoration: none;
}

a.mainText:hover {
	color: blue;
	font-family: Arial, Tahoma, sans-serif;
	font-size: 12px;
	text-decoration: underline;
}

a.mainText:visited {
	color: navy;
	font-family: Arial, Tahoma, sans serif;
	font-size: 12px;
	text-decoration: none;
}

.textSubtitle {
	color: #333333;
	font-family: Arial, Tahoma, "MS Sans Serif";
	font-size: 14px;
	text-decoration: none;
}

a.textSubtitle {
	color: navy;
	font-family: Arial, Tahoma, sans serif;
	font-size: 14px;
	text-decoration: none;
}

a.textSubtitle:visited {
	color: #804000;
	font-family: Arial, Tahoma, sans serif;
	font-size: 14px;
	text-decoration: none;
}

a.textSubtitle:hover {
	color: blue;
	font-family: Arial, Tahoma, sans-serif;
	font-size: 14px;
	text-decoration: underline;
}
I have then tried placing the class calls in a <td>, a <p>, a <div>, and a <span>,with the code <td class="textMain">, etc.

I thought that if the cell had standard text, it would show the color #999999;, but when an <a> link is inserted, it would then change the text to the a.textMain class.

The only links that will appear are the standard 'a' classes, and not the different links I am asking for.

What am I doing wrong.

Thanks all.

Pete.
__________________
Pandas do 4 things well.
Eating bamboo is boring.
The other 2 aren't allowed in avatars.
cnelson04's Avatar
Senior Member with 898 posts.
 
Join Date: Dec 2003
01-Nov-2006, 10:07 PM #2
Hmmm, maybe try <a href="blah.html" style="textmain"> I think this is how i got mine to work. But i don't remeber exactly. -cnelson.
cnelson04's Avatar
Senior Member with 898 posts.
 
Join Date: Dec 2003
01-Nov-2006, 10:11 PM #3
Hmm, i think i found out why you have..
"a.maintext:link" it should be..

".maintext a:link"

then..
<div class="maintext">
<a href="#">Menu Link</a>
<a href="#">Menu Link</a>
<a href="#">Menu Link</a>
</div>
-cnelson.
pandapete's Avatar
Member with 40 posts.
 
Join Date: Aug 2006
Location: Cairns, Australia
Experience: Learning every day
01-Nov-2006, 11:07 PM #4
Thanks for that.

It works.

Wonder why a style sheet I was looking at for inspiration was written the other way.

No worries, all sorted.
Big-K's Avatar
Distinguished Member with 6,883 posts.
 
Join Date: Nov 2003
Location: Kansas
Experience: Advanced
01-Nov-2006, 11:42 PM #5
it can also be a:link.main i believe
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:08 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.