开发者

Making links the size of their parent?

开发者 https://www.devze.com 2023-03-27 20:30 出处:网络
Yeah, I was wondering if there\'s a way to make a link the size of it\'s parent. See, I\'m trying to make my drop-down menu\'s links stretch across the width of the .menu class they\'re embedded in. B

Yeah, I was wondering if there's a way to make a link the size of it's parent. See, I'm trying to make my drop-down menu's links stretch across the width of the .menu class they're embedded in. But it's not working even though I have everything else embedded in between as width: 100%;

Can anyone tell me how to make make my drop-down menu's links stretch across t开发者_StackOverflowhe width of the .menu class they're embedded in? Here is the link to my site


Make the links display: block; You won't need the 100% width then (which will actually make the links too wide, because of the padding).

In general you'll want to be conservative with setting width 100% on elements, as with the standard box model that 100% does not include padding/margin/border on the element, and will often push it outside the bounding box of its parent.


You could try display:block on your a tags inside the menu.

0

精彩评论

暂无评论...
验证码 换一张
取 消