3 replies [Last post]
generalinq
Offline
newbie
Last seen: 15 years 21 weeks ago
Joined: 2007-10-30
Posts: 2
Points: 0

Hi

This is my first post Smile yay...

I am trying to find out how to position text that has a background image in an LI (UL list).

Everytime I try to position it, it moves the entire image as well instead of just the text. ie. if I move the text up, all the images in the UL move up as well. Essentially, the image moves and not the text. Right now the text is at the top of the image and to the left.

Here is my code below. Not sure what I am doing wrong. I'm new at this which is why I am asking for help. I've attached an image of the menu so you can see what I am talking about. I basically want the text to be ON the tab and not above it.

Here is my css for that:

#menu { float: left; width: 418px; height: 97px;

}

#menu ul {
margin: 0px;
padding: 0px;
list-style: none;
}

#menu li {
display: inline;
}

#menu a {
float: left;
height: 97px;
text-decoration: none;
}

#menu span {

}

#menu1 { width: 94px; background: url(images/homepage02.jpg) no-repeat left top; }
#menu2 { width: 90px; background: url(images/homepage03.jpg) no-repeat left top; }
#menu3 { width: 100px; background: url(images/homepage04.jpg) no-repeat left top; }
#menu4 { width: 134px; background: url(images/homepage05.jpg) no-repeat left top; }

AttachmentSize
tabs.jpg10.86 KB
Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 37 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

A live link would be better,

A live link would be better, and we need all your code.

Thanks.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

generalinq
Offline
newbie
Last seen: 15 years 21 weeks ago
Joined: 2007-10-30
Posts: 2
Points: 0

solved

I've solved it by adding some padding to the top. Thanks anyhow.

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 48 weeks 3 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

You could also look into

You could also look into line-height Wink

Verschwindende wrote:
  • CSS doesn't make pies