Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Horizontal Menu: display: inline AND block? Make link cover whole LI?

Tags:

css

inline

menu

Normally, to make the link fill out the whole li, I use display: block;. But with a horizontal menu, I need to set it to display:inline; so it goes in one line. I've tried display:inline-block; but that doesn't help. I've seen horizontal menus that accomplish this, but I can't find out how from their source.

Any ideas? Thanks.

like image 616
MrBubbles Avatar asked Dec 21 '22 20:12

MrBubbles


1 Answers

Apply height and width to the parent li elements, and then:

a {
display: inline-block;
height: 100%;
width: 100%;
}

JS Fiddle demo.

like image 138
David Thomas Avatar answered Jan 13 '23 12:01

David Thomas