Beispiel:Flexbox-1.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche

<!DOCTYPE html> <html lang="de"> <head>

 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <link rel="stylesheet" media="screen" href="./Beispiel:Grundlayout.css">
 <title>Flexbox - 1</title>
 <style>

nav {

 display: flex;

}

ul {

 display: flex;
 gap: 1em;
 margin-left: 0; /*auto */

}

nav li {

   background: gold;
   border: thin solid;
   border-radius: 0 0.5em 0.5em;
   list-style-type: none;
   padding: 0.5em 1em;

}</style> </head> <body>

Flexbox 1 - flexibler Container

<nav>

 

</nav>

Ändere den Wert für margin-left auf auto und beobachte, was passiert.

</body> </html>