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 ... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
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 |
| | |
| | #2 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
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 |
| | |
| | #3 |
![]() Join Date: Feb 2010 Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
![]() Expertise: Web Development Experience: Professional |
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.. |
| | |
| | #4 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
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 |
| | |
| | #5 |
![]() Join Date: Feb 2010 Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
![]() Expertise: Web Development Experience: Professional | Code: #menu ul li a:active { color: #000; background: yellow; }
|
| | |
| | #6 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
sweet, and I must be really tired.. lol.. what about selected ?
__________________ web design kent |
| | |
| | #7 |
![]() Join Date: Feb 2010 Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
![]() Expertise: Web Development Experience: Professional |
a:active is when you click; selected... Do you mean when have visited the link? a:visited |
| | |
| | #8 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
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 |
| | |
| | #9 |
![]() Join Date: Feb 2010 Location: Varna, Bulgaria
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
![]() Expertise: Web Development Experience: Professional |
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>
|
| | |
| The Following User Says Thank You to kozata-xakep For This Useful Post: | saltedm8 (14th February 2010) |
| | #10 |
![]() Join Date: Dec 2008 Location: Kent Uk
Posts: 1,595
Blog Entries: 6 Thanks: 15
Thanked 49 Times in 49 Posts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Expertise: (X)HTML / CSS Experience: Professional |
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 |
| | |
![]() |
| Tags |
| menu, overlapping |
| Thread Tools | |
| Display Modes | |