There is the usual navigation :

HTML:

<nav> <ul> <li><a href="">Продукция</a></li> <li><a href="">Сообщества</a></li> <li><a href="">Мероприятия и акции</a></li> <li><a href="">Поддержка</a></li> </ul> </nav> 

CSS:

 nav { font-size: 0; line-height: 0; letter-spacing: -1px; } nav li { display: inline-block; } nav a { display: block; background: #000; padding: 0 10px; font-size: 17px; line-height: normal; letter-spacing: normal; color: #fff; } nav li:nth-child(2n) a { background: #666; } 

How do menu items stretch across the entire width of the nav block so that the padding of all links is the same (there should not be empty space between the links, is this space allocated to the internal indents of the links)?

UPD:

An image of how the menu should be displayed. enter image description here

    2 answers 2

    Put display: flex parent, flex-basis: auto + flex-grow: 1 - to descendants.

     body, ul { margin: 0; padding: 0; } ul { display: flex; } ul li { list-style-type: none; flex-basis: auto; flex-grow: 1; background: #000; text-align: center; } ul li:nth-child(2n) { background: #ccc; } ul li a { padding: 20px 0; text-decoration: none; color: #ccc; display: block; } ul li:nth-child(2n) a { color: #000; } 
     <nav> <ul> <li><a href="">Продукция</a></li> <li><a href="">Сообщества</a></li> <li><a href="">Мероприятия и акции</a></li> <li><a href="">Поддержка</a></li> </ul> </nav> 

      Option on Flexbox

       body, ul { margin: 0; padding: 0; } ul, ul li, ul li a { display: -webkit-box; display: -ms-flexbox; display: flex; width: 100%; } ul { text-align: center; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; } ul li a { min-height: 70px; text-decoration: none; color: #333; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } ul li a:hover { background: #eee; } 
       <nav> <ul> <li><a href="">Продукция</a></li> <li><a href="">Сообщества</a></li> <li><a href="">Мероприятия и акции</a></li> <li><a href="">Поддержка</a></li> </ul> </nav> 

      • The same option as above :-) The internal indents of the links are different. - Frontender
      • Which option is higher? The width of the list items is the same, the menu itself is stretched wide. Or do you want the indents between the text to be the same? - Alexey Giryayev
      • In this case, the width of the points is the same. Attached a picture to the question. - Frontender
      • Now it is clear. In general, the answer you have already given below. - Alexey Giryayev