overlapping menu

This is a discussion on overlapping menu within the CSS forums, part of the Development category; For the first time in ages, I am having issues with a menu. I am trying to create an overlapping ...


Reply
 
LinkBack Thread Tools Display Modes
Old 14th February 2010, 04:45 PM   #1
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default overlapping menu

For the first time in ages, I am having issues with a menu. I am trying to create an overlapping menu, where when you hover over it, it goes blue.. the problem is I cant seem to 'cover' all the red.. please check it out to see what I mean

Code:
#menu{
    float: left;
    width:324px;
    height:130px;
    margin-top:15px;

}

#menu ul { 
     list-style-type:none; 
     margin-left:70px;
     font-family:Verdana, Geneva, sans-serif;
     font-size:14px;
     line-height:25px;
     color:#FFF;
}
.shift { margin-left:10px;}
.shift a { color: #FFF; text-decoration:none; }
.home { background-color:#a10006; width:90px; display:block;}
.about { background-color:#b20f18; width:140px; display:block;}
.prices { background-color:#a10006; width:100px; display:block; margin-top:-5px;}
.view { background-color:#b20f18; width:210px; display:block;}
.contact { background-color:#a10006; width:115px; display:block; margin-top:-5px;}

.home a:hover { background-color:#00006b; padding:4px 40px 4px 0; }
.about a:hover { background-color:#00006b; width:140px; }
.prices a:hover { background-color:#00006b; width:100px; margin-top:-5px;}
.view a:hover { background-color:#00006b; width:210px;}
.contact a:hover { background-color:#00006b; width:115px; margin-top:-3px;}
HTML Code:
<div id="menu">
<ul>
<li class="home"><span class="shift"><a href="#">Home</a></span></li>
<li class="about"><span class="shift"><a href="#">About All Star</a></span></li>
<li class="prices"><span class="shift"><a href="#">Our Prices</a></span></li>
<li class="view"><span class="shift"><a href="#">View All Star Belt Gallery</a></span></li>
<li class="contact"><span class="shift"><a href="#">Contact</a></span></li>
</ul>

</div> 

this is pretty urgent if anyone can help.. cheers
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 06:54 PM   #2
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

dont worry, thanks for looking, succeeded with this

Code:
#menu{
    float: left;
    width:324px;
    height:130px;
    margin-top:15px;

}

#menu ul { 
     list-style-type:none; 
     margin-left:70px;
     font-family:Verdana, Geneva, sans-serif;
     font-size:14px;
     line-height:25px;
     color:#FFF;
}

.shift a { color: #FFF; text-decoration:none; padding-left:10px;
}
.home { background-color:#a10006; width:100px; display:block;}
.about { background-color:#b20f18; width:150px; display:block;}
.prices { background-color:#a10006; width:110px; display:block; margin-top:-5px;}
.view { background-color:#b20f18; width:220px; display:block;}
.contact { background-color:#a10006; width:125px; display:block; margin-top:-5px;}

.home a:hover { background-color:#00006b; width:90px; display:block; }
.about a:hover { background-color:#00006b; width:140px; display:block; }
.prices a:hover { background-color:#00006b; width:100px; margin-top:-5px; display:block;}
.view a:hover { background-color:#00006b; width:210px; display:block;}
.contact a:hover { background-color:#00006b; width:115px; margin-top:-3px;display:block; }
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 06:57 PM   #3
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Default

Hey mate,

Do you want to hover the link and make it all blue ?

Edit:

I've noticed that you made every list item display: block; By default they are block elements; or else just use #menu ul li { display: block; } ?

Last edited by kozata-xakep; 14th February 2010 at 07:02 PM..
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 07:28 PM   #4
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

thanks for the reply, and nice to finally chat lol

the reason for the display blocks is because otherwise it only surrounded the text and refused to stretch along further than the actual links name.

I would however be curious if you can think of a way to get a:active to work.. that is currently stumping me a little lol
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 07:33 PM   #5
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Default

Code:
#menu ul li a:active { color: #000; background: yellow; }
That works fine for me :)
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 07:54 PM   #6
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

sweet, and I must be really tired.. lol.. what about selected ?
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 08:01 PM   #7
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Default

a:active is when you click;
selected... Do you mean when have visited the link?
a:visited
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 08:04 PM   #8
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

the page you are on... current page highlighted..

soz, shows how tired I am when I cant even describe what I want right lol
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 14th February 2010, 08:12 PM   #9
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Default

You can use a class for that:

Code:
<div id="navigation">
        <ul>
            <li><a href="#" class="active">Link</a></li>
            <li><a href="#">Link</a></li>
            <li><a href="#">Link</a></li>
            <li><a href="#">Link</a></li>
        </ul>
    </div>
or the a:visited {}
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
The Following User Says Thank You to kozata-xakep For This Useful Post:
saltedm8 (14th February 2010)
Old 14th February 2010, 08:17 PM   #10
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

nah lol.. it wont work with visited, I dont think I will bother.. the guy is not paying enough for me to be messing about with it this much lol

thanks
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
menu, overlapping

Thread Tools
Display Modes