Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 01-02-2008, 06:20 AM display property
Average Talker

Posts: 20
Name: Levi
Trades: 0
I'm trying to get my nav bar to display my links horizontally. Well actually I got that, and I got my background image to show for them as well. What I am having problems with is when I do the mousover it only wants to display the hover background image to the size of the text link and not the entire size of it.

I am using inline to make the links one after another and cannot find a good work around for it other than to do display:block but then they are vertical links and not horizontal and the inline-block style isn't supported by any major browser so... any ideas?

Currently I tried to pad my links out so that the image would show and it worked kinda...but when I move my mouse over the link it adds the padding for my li and the additional padding for my hover and so it moves my links over like 40px to the right on hover and it just doesn't work. I can't really figure this one out aside from actually putting the image into the html page and using javascript to change it.

Code:
ul#links
{
    width:900px;
    height:40px;
    background-image:url(../images/link.png);
    background-repeat:repeat-x;
    margin:0;
    padding:0;
}

#links li
{
    display:inline;
    padding:0 40px 20px 40px;
    background-color:#000000;
}

#links li a:hover
{
    background-image:url(../images/hover.png);
    background-repeat:repeat-x;
    padding:0 40px 20px 40px;
}
Levi_ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-02-2008, 07:02 AM Re: display property
Average Talker

Posts: 29
Name: Jean
Trades: 0
Hi,

Do you have a test url ?
MarvinLeRouge is offline
Reply With Quote
View Public Profile
 
Old 01-02-2008, 07:07 AM Re: display property
Average Talker

Posts: 20
Name: Levi
Trades: 0
Yeah, sorry I thought i included it.

http://levijackson.net/sites/Missing%20Piece/
Levi_ is offline
Reply With Quote
View Public Profile
 
Old 01-02-2008, 03:20 PM Re: display property
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Add this:
#links li a{display: block;}
That will make the link take up the full width of the list.

You have bigger problems, that menu is all over the place in Firefox, but solve one problem at a time
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-02-2008, 09:22 PM Re: display property
Average Talker

Posts: 20
Name: Levi
Trades: 0
I had tried that earlier and I just tried it again, all that does is make it display block and take it out of inline styling. It should work because i saw that as how it was done on some examples but it doesn't work here for some reason.
Levi_ is offline
Reply With Quote
View Public Profile
 
Old 01-02-2008, 10:39 PM Re: display property
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
The display: inline for the horizontal menu should be on #links li, display:block goes on the <a>inside the <li>.

You also need to put the background on the <a> and set the margin and padding the same as you have it for the a:hover, that should stop the jumping around.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to display property
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20807 seconds with 12 queries