|
| |
|
|
lilblackgirl
Posts: 288 Joined: 5/16/2002 From: Status: offline
|
drawing a blank - 2/15/2007 9:36:34
This is basic, but my brain won't work this morning. in my stylesheet, if i set my basic link settings as so: a, a:visited { color: #ffffff; text-decoration: underline; } a:hover { color: #000; background-color: #7a7f9a; text-decoration: none; } and i have a graphic that links to an outside address, by default, the link settings above will apply to the graphic. How do i set the link settings for the graphic to not do this? I just want to be able to hover and click without any style settings being applied to the graphic. I thought of setting it to a class/id, but i shouldn't have to set up a special class/id to counter the default settings, should I? I know this is a silly question, but i'm drawing a blank.
_____________________________
You look like you're about to do something stupid. I'm in.
|
|
|
|
Tailslide
Posts: 5948 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: drawing a blank - 2/15/2007 10:31:12
Yes you need to set up a specific class for the different links. Unless you tell it otherwise it will apply the default settings.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
mtfm
Posts: 421 Joined: 1/13/2006 From: Mesa, AZ Status: offline
|
RE: drawing a blank - 2/15/2007 10:34:41
If the image is a link, the style will be applied unless you add something else. instad of an id or class, couldn't you apply css to the img tag? And as long as that declaration was after the link ones, it should be ok.
_____________________________
Is this possible? How about this? What about....?
|
|
|
|
Tailslide
Posts: 5948 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: drawing a blank - 2/15/2007 10:43:01
Adding inline CSS is a bad idea for the vast majority of cases (can't think of an exception off hand). You'd lose the ability to reuse and change the class throughout the site. Just declare a class in the stylesheet for the image links.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
mtfm
Posts: 421 Joined: 1/13/2006 From: Mesa, AZ Status: offline
|
RE: drawing a blank - 2/15/2007 11:10:10
I didn't mean apply it inline, though I see how one read it that way. After the other declarations (and in the external stylesheet), couldn't you make a declaration that all attributes with the img tag are not underlined, etc? And as long at it was in the stylesheet after the link declarations, it would apply to all images, even those with a link.
_____________________________
Is this possible? How about this? What about....?
|
|
|
|
Tailslide
Posts: 5948 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: drawing a blank - 2/15/2007 11:19:30
I find it more reliable to actually declare a class for this sort of thing - you can specify img {border:0} for all images and that does away with the standard link border which may be all you need. But if you need to do any more than that then you're better off with an actual class as links can be a bit tricky at times (that may well just be me though!). edit: should be border:none;
< Message edited by Tailslide -- 2/15/2007 12:40:12 >
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
lilblackgirl
Posts: 288 Joined: 5/16/2002 From: Status: offline
|
RE: drawing a blank - 2/15/2007 12:04:38
But is creating a class, just for the sake of cancelling out all of the default link settings the correct way to do it? And how do those settings applied to a graphic as opposed to text differ? For example, on hover, if my default link setting changes the background color, it's doing the same on the graphic.
_____________________________
You look like you're about to do something stupid. I'm in.
|
|
|
|
Tailslide
Posts: 5948 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: drawing a blank - 2/15/2007 12:42:29
Yes it's correct or I wouldn't suggest it. You can try the border:none (not border:0 - in too much of a hurry) applied to images and see if that works. If not set up a class and add it to the graphics or any other link you don't want to have the default colours/styles to cancel the defaults out. This is how CSS works - you set up defaults then add in the exceptions as classes or ids.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
lilblackgirl
Posts: 288 Joined: 5/16/2002 From: Status: offline
|
RE: drawing a blank - 2/15/2007 15:22:32
quote:
How else are you going to do it? I don't, which is why i was asking. i felt like i was overlooking something obvious, but if that's the way it's gotta be done, then that's how i'll do it.
_____________________________
You look like you're about to do something stupid. I'm in.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|