Menu responsive avec Flexbox - 1
How do I make an menu responsive avec flexbox - 1?
What is a menu responsive avec flexbox - 1? How do you make a menu responsive avec flexbox - 1? This script and codes were developed by Damien Flandrin on 12 June 2022, Sunday.
Menu responsive avec Flexbox - 1 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Menu responsive avec Flexbox - 1</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav class="nav" role="navigation"> <ul> <li><a href="#">Accueil</a></li> <li><a href="#">Catégories</a></li> <li><a href="#">À Propos de Moi</a></li> <li><a href="#">Contact</a></li> </ul>
</nav>
<a style="position: absolute; left:0px; right:0px; bottom: 10px; margin:auto; display:block; text-align:center;" href="https://www.damienflandrin.fr/blog/post/tutoriel-raliser-un-menu-responsive-avec-flexbox">En savoir plus sur https://www.damienflandrin.fr</a>
</body>
</html>
Menu responsive avec Flexbox - 1 - Script Codes CSS Codes
@charset "UTF-8";
/* ----------------- Étape 1 - La base
------------------- */
.nav ul { margin: 0px; padding: 0px; background: tomato; list-style: none;
}
.nav a { padding: 1em; display: block; text-align: center; text-decoration: none;
}
/* -----------------
Étape 2 - Le menu
1 - On défini l'affichage en mode flexbox.
2 - Avec flex-direction, on souhaite que les enfants de notre élément courant soit aligné en ligne.
3 - justify-content nous permet d'alligner les enfant à gauche, au centre ou à droite de notre élément courant
4 - Une fois sur une résolution de type mobile, avec l'aide de flex-flow qui est un raccourcie de flex-direction est de flex-wrap, on affiche les enfants par colonnes et on autorise le retour à la ligne.
----------------- */
.nav ul { display: flex; /*1*/ flex-direction: row; /*2*/ justify-content: center; /*3*/
}
@media (max-width: 450px) { .nav ul { flex-flow: column wrap; /*4*/ }
}
Developer | Damien Flandrin |
Username | dam62500 |
Uploaded | June 12, 2022 |
Rating | 3 |
Size | 2,667 Kb |
Views | 135,608 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
LAMP PURE CSS with Animation | 2,911 Kb |
Menu responsive avec Flexbox - 2 | 3,955 Kb |
Description list inline | 1,741 Kb |
Make a grid with Neat 2.0 | 5,522 Kb |
Card UI CSS | 2,897 Kb |
A Pen by Damien Flandrin | 3,438 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS Colors | Alexpate | 2,232 Kb |
RAQuote | Naderk007 | 4,412 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Wikipedia Viewer | Thalpha | 4,426 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
React Recipe Box | Krokodill | 5,347 Kb |
Loader | MikitaLisavets | 3,321 Kb |
Cut and Paste Roll Link | BottomlineInteractive | 2,546 Kb |
Alter bg opacity on hover... | Chrisboon27 | 2,054 Kb |
HTML5 Breakout | Jaysalvat | 4,873 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!