CSS li hover.

This is a discussion on "CSS li hover." within the Web Page Design section. This forum, and the thread "CSS li hover. are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 17th, 2007, 15:10
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
CSS li hover.

Site; http://www.360sigs.com/360sigslayoutnew/categories.php
Css; http://www.360sigs.com/360sigslayoutnew/style.css

Problem CSS;

HTML: Select all
ul.libary{
    margin: auto;
    padding: 0px;
    list-style: none;
    display: block;
}

ul.libary li {
    overflow: hidden;
    margin: 0px 2px 0px 0px;
    padding: 2px;
    float: left;
    text-align: center;
    font-size: 9px;
    background-color: #ffffff;
    border: 1px solid #000000;}

ul.libary  li a:hover {
color: #ffffff;
background-color: #343434;
}
    
.libary li a:link, .navlinks li a:visited, .navlinks li a:active{
color: #000000;
Problem;

Hover over the Library part and it only uses the Li hover to cover the font. How can I fix it to ignore the padding and fill the whole box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 17th, 2007, 15:23
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: CSS li hover.

Try getting rid of the li padding and setting your anchors to display:block, then adding padding to your anchors.

If I understand you correctly, the reason the whole box is not changing colour is because the anchor is not completely filling the space - the li padding is giving it that 'edge'.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 17th, 2007, 15:27
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

You're right and I knew this, but then the text will touch the border and it looks untidy..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 17th, 2007, 18:15
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: CSS li hover.

But surely if you set your anchors to block elements, then add padding to them, they'll pad out the li's themselves?
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 17th, 2007, 19:41
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

I'm slightly confused now
HTML: Select all
ul.libary  li a:hover {
    display:block;
    padding: 0px;
    color: #ffffff;
    background-color: #343434;
}
like that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 17th, 2007, 20:05
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

Not quite. Add some padding to the "a", and take any padding away from the li.

This doesn't belong in the hover style. Apply it to the raw "a": a { display: block; padding; 1em; }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 17th, 2007, 23:24
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

That makes all the layout mess up pretty much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Dec 17th, 2007, 23:35
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: CSS li hover.

Ok try this

Replace all of this
Code: Select all
ul.libary li {
    overflow: hidden;
    margin: 0px 2px 0px 0px;
    padding: 2px;
    float: left;
    text-align: center;
    font-size: 9px;
    background-color: #ffffff;
    border: 1px solid #000000;}

ul.libary  li a:hover {
    display:block;
    color: #ffffff;
    background-color: #343434;}
with this:

Code: Select all
ul.libary li {
    overflow: hidden;
    margin: 0px 2px 0px 0px;
    float: left;
    text-align: center;
    font-size: 9px;
    background-color: #ffffff;
    border: 1px solid #000000;}

ul.library li a {
    display: block;
    padding: 2px;}

ul.libary  li a:hover {
    color: #ffffff;
    background-color: #343434;}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Dec 18th, 2007, 11:23
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

Hmmm, didn't do anything =/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Dec 19th, 2007, 14:26
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS li hover.

Any idea?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
css hover alexgeek Web Page Design 9 Aug 2nd, 2007 18:18
hover box gallery acrikey Web Page Design 25 Jul 19th, 2007 22:39
hii Help with hover hawashp Starting Out 1 May 13th, 2007 16:35
Javascipt or a:hover??????? Tom87 Web Page Design 20 Mar 28th, 2007 01:11


All times are GMT. The time now is 01:25.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42