0

I know this is probably a stupid question. But say I have a navigation menu, would it be more practical to set a fixed height..

 nav {
 background: red;
 Width: 80%;
 height: 60px;
 }

 nav ul li {
 Line-height: 60px;
 }

Or to use padding to define the height?

 nav {
 background: red;
 Width: 80%;
 Padding: 30px 0;
 }

I usually go with the first choice. But I'm worried that the font size might change in different computers/browsers and therefore becomes unproportional with the container. Could this actually happen?

2
  • Maybe you can use min-height instead of height. This way, if your text goes bigger, your menu will resize.
    – Agate
    May 28, 2014 at 13:51
  • can u share a fiddle file?
    – user2628521
    May 28, 2014 at 13:59

1 Answer 1

0

Your vertical padding should probably go on the

nav ul li a

That way, if the anchor text scales up, so does your header and everything doesn't break out, and you have a larger clickable area. Also, don't leave the anchor display inline.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.