Interactive online courses HTML Academy
2026-03-09 10:54 Diff

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The adaptive horizontal menu, part 3

You can also use Flexbox to manage the visual sequence of items without having to change the HTML code.

Let’s replace one of the menu items with a logo block, and then we can easily reposition it to various places using the order property.

Comments

  • index.html
  • style.css

HTML

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Adaptive menu, part 3</title> <link href="course.css" rel="stylesheet"> <link href="style.css" rel="stylesheet"> </head> <body class="subtle"> <header> <div class="logo"> <img src="img/keksby.svg" alt=""> </div> <div class="menu"> <div> <a href="#">Meat</a> </div> <div> <a href="#">Fish</a> </div> <div> <a href="#">Sour Cream</a> </div> <div> <a href="#">Milk</a> </div> <div> <a href="#">Cheese</a> </div> </div> </header> </body> </html>

CSS

.menu { display: flex; justify-content: space-around; } .logo { }

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%

  1. Cut the .logo block and paste it inside the menu to replace the div with the text Sour Cream.
  2. Then assign center alignment for the items along the cross axis for the .menu.
  3. Assign the flex item sequence number -1 to the .logo block,
  4. and then assign it 1.