navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

drawing a blank

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> drawing a blank
Page: [1]
 
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

(in reply to lilblackgirl)
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....?

(in reply to lilblackgirl)
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

(in reply to mtfm)
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....?

(in reply to Tailslide)
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

(in reply to mtfm)
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.

(in reply to Tailslide)
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

(in reply to lilblackgirl)
jaybee

 

Posts: 14097
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: drawing a blank - 2/15/2007 13:11:13   
quote:

But is creating a class, just for the sake of cancelling out all of the default link settings the correct way to do it?
How else are you going to do it? You've told it to apply xyz to all links, now you want one that doesn't use xyz so you have to tell it, in this case, use abc instead.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
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.

(in reply to jaybee)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> drawing a blank
Page: [1]
Jump to: 1





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