Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
Why does not max-width? - bug-code.com Q&A

Why does not max-width?

0 like 0 dislike
45 views
Hello! Please help me to understand why does not work property max-width: 1650px; for a block with class "header-wrapper".

I wrote max-width: 82.1% and it worked. The page now looks the way I would need:

5be827345eac8890531479.jpeg

However, when you shrink the page, then the green block header-wrapper somehow "falls" menu:

5be827a4e716b497954995.jpeg

Somewhere I screwed up. But I do not understand where.

Code HTML:

<!DOCTYPE html>Merkury Landing Page


Code CSS:

*{ padding: 0; margin: 0; } .clearfix:after { clear: both; content: "; display: table; } html{ background: #03050b; } header{ background: red; } .header-wrapper{ background: green; max-width: 1650px; margin: 0 auto; display: flex; } .header-wrapper img{ width: 238px; } .menu{ display: flex; list-style: none; } .menu li{ padding-left: 50px; }
asked by | 45 views

1 Answer

0 like 0 dislike
The property flex-wrap flex said container to move the item to a new position if it doesn't fit or not. By default, elements are not transferred.
The picture is set to fixed width. Either change the media queries to the width to each device, or to make rubber.
Why do you need clearfix, if you use flex?
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

12.3k users

24,788 questions
46,220 answers
0 comments
12,337 users