There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
More CSS problems


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
lola2001's Avatar
Computer Specs
Senior Member with 1,904 posts.
 
Join Date: Jan 2001
Location: Ontario, Canada
01-Oct-2003, 05:06 PM #1
More CSS problems
Can someone look at the code from my website.

I am using CSS to make different rollover colors, however I have noticed that I must call for the class in every single link like this:

<a href="#" class=smallgray>Animals

But when I do that, the font and size get all srewed up.

Is it necessary to call the class everytime? I don't remember having to do that before. I know I'm doing something wrong but what? Thanks.
__________________
Millions of people believe in God, yet nobody has seen him. Millions of people have seen UFO's yet nobody believes in them
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
02-Oct-2003, 10:47 AM #2
THe reason is because you are using more than one rollover effect for the page. You have a lightgrey one and a darkblue one as well. If you used the same effect for rollovers on the entire page you could handle them all with the single class for all links. Since you have two seperate types you have to define them separately. That's why it wasn't working initially.
__________________
**Disclaimer** Anything below this line ^ is part of my signature for those that may be confused

Sadly, there are no integers on this scale, so your gangly adolescent attempt to be clever has proved futile....Dieter

I have the right "NOT" to be tolerant of others because they are different, weird, or tick me off.....Parody of Andy Rooney

There are no stupid questions, but there are a LOT of inquisitive idiots.
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
02-Oct-2003, 10:58 AM #3
Yep, if you just do an 'a' by itself like so, it will act as a default, then use your custom ones to define the rest of the anchor classes
Code:
a {
//css here
}
a.smallgray {
//css here
}
--HTH
lola2001's Avatar
Computer Specs
Senior Member with 1,904 posts.
 
Join Date: Jan 2001
Location: Ontario, Canada
02-Oct-2003, 11:53 AM #4
I don't quite understand. What am I supposed to so with the a? Thanks.
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
02-Oct-2003, 12:09 PM #5
It's sets the default style for all < a > tags...so you don't need to add the class to them
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
02-Oct-2003, 12:11 PM #6
The a represents the attributes for all a tags on a web page if used in a stylesheet.....if you set the attribute for a by itself it will be a global style on your page for all of those tags. You can use classes of the attribute but you will have to define it every time like you have discovered.
__________________
**Disclaimer** Anything below this line ^ is part of my signature for those that may be confused

Sadly, there are no integers on this scale, so your gangly adolescent attempt to be clever has proved futile....Dieter

I have the right "NOT" to be tolerant of others because they are different, weird, or tick me off.....Parody of Andy Rooney

There are no stupid questions, but there are a LOT of inquisitive idiots.
lola2001's Avatar
Computer Specs
Senior Member with 1,904 posts.
 
Join Date: Jan 2001
Location: Ontario, Canada
02-Oct-2003, 12:14 PM #7
Um...you lost me on the last two posts. So...what you are saying is that yes, I must define the class everytime? Sorry, I'm a little slow today.
khaki's Avatar
Distinguished Member with 2,433 posts.
 
Join Date: Jul 2003
02-Oct-2003, 12:33 PM #8
hi lola...

what they are saying is that you can take your current style (below)

<style type="text/css">
<!--
a.blueover:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #3D3E90;
}
a.grayover:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #D4D0C8;
}
a.smallgray:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #D4D0C8;
}

-->
</style>


and then change it to this :

<style type="text/css">
<!--
a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #3D3E90;
}
a.grayover:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #D4D0C8;
}
a.smallgray:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #D4D0C8;
}

-->
</style>


...and then you only need to define the classes that you want to be different than the default (in bold above)

like this (from your source-code) :

<a href="#">Home</a>
<a href="#">Search</a>
<a href="#">View</a>


.....

<a href="#" class=smallgray>Animals &amp; wildlife</a><br>
<a href="#">Architecture</a><br>
<a href="#">Arts &amp; Culture</a><br>

.....

<a href="#" class=grayover>Free image download</a>


This will reduce 1 instance of having to define a class... as all non-defined < a > tags will assume the formatting of the default.

Does that help you understand it better?
lola2001's Avatar
Computer Specs
Senior Member with 1,904 posts.
 
Join Date: Jan 2001
Location: Ontario, Canada
02-Oct-2003, 12:38 PM #9
Oh.........I get it! Thanks! Was starting to think I should quit my job..... it wasn't as hard as I was trying to make it. Thanks a lot.
khaki's Avatar
Distinguished Member with 2,433 posts.
 
Join Date: Jul 2003
02-Oct-2003, 12:49 PM #10
Quote:
Originally posted by lola2001:
Oh.........I get it! Thanks! Was starting to think I should quit my job..... it wasn't as hard as I was trying to make it. Thanks a lot.
i know ....
it can be hard enough sometimes, without making it even harder on yourself

and just to keep things in order....
you should really define all instances of the < a > tag
(like this)

a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #3D3E90;
}

a:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #636;
}

a:active {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #ff0;
}

a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #c00;
}


it's not absolutley essential....
but it will cut-down on unexpected headaches when you have a lot of style on a page.

(Note: the colors are up to you.... I just plugged-in whatever )

k
lola2001's Avatar
Computer Specs
Senior Member with 1,904 posts.
 
Join Date: Jan 2001
Location: Ontario, Canada
02-Oct-2003, 12:52 PM #11
Great, thanks for doing that for me. I'll just modify it..makes things easier for me. For some reason CSS has been a pain in my butt for a long time. it's just hard for me to get.
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
02-Oct-2003, 01:39 PM #12
Thanks K, their is a reason I'm not a teacher
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


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 07:39 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.