2 replies [Last post]
SuperGrover1981
Offline
newbie
Last seen: 14 years 2 weeks ago
Joined: 2005-11-04
Posts: 5
Points: 0

Hi gang,

I'm currently trying to get a background image to display in an <a href="xyz.html" class="xyz" style="background:url(xyz.png)"> tag.

There isn't any content within the <a> tag, and it seems to be ignoring the width & height specifications in CSS class/style - the background only starts to show if I enter "hard" content between the <a> and </a> tags.

If anyone has any ideas on how to get around this, I'd be most appreciative.

Many thanks,
- JB

/locked. numpty.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

and it's not meant to

and it's not meant to acknowledge width or height anchors are text/inline elements and as such have no use for height or width.

You need to a search around for the use of display:block.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 46 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Ah a time waster thanks JD

Ah a time waster thanks JD Wink

It's not proper to cross post to multiple forums, I see that you have the answer from sitepoint, wonder if you were intending on poping back here and closing off the thread?, not that you did with your previous two posts here!

Incidentally your last post was along the same lines as this one and elicited the display block requirement for anchors when needing to give them dimensions, so that seemed to have been wasted effort, ho hum Smile

Edit/ well what you know posted to digitalpoint as well!you are doing well JD tell me why do you think it's ok to tie as many people up with your problem as possible? Smile

Edit,edit/ and on webmaster world, so that makes four forums you posted this question to!

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me