🏠 Accueil 📚 Répertoire

Méthodes pour créer des boutons de rappel (vers l'accueil, le répertoire, ...)

BAS
Position CSS (fin <style>) HTML
DROITE
.bottom-right { position: fixed; bottom: 20px; right: 20px; display: flex; gap: 10px; z-index: 1000; }
<div class="bottom-right"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste avant </body>
CENTRE
.bottom-center { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 1000; }
<div class="bottom-center"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste avant </body>
GAUCHE
.bottom-left { position: fixed; bottom: 20px; left: 20px; display: flex; gap: 10px; z-index: 1000; }
<div class="bottom-left"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste avant </body>
Position dans tous les cas de figure : .btn-retour Code CSS (fin <style>)
DROITE, CENTRE OU GAUCHE
.btn-retour { display: inline-block; padding: 12px 20px; background: #007BFF; color: white; text-decoration: none; border-radius: 8px; font-weight: 600; }
HAUT
Position CSS (fin <style>) HTML
DROITE
.top-right { position: fixed; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1000; } body { padding-top: 80px; }
<div class="top-right"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste après <body>
CENTRE
.top-center { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 1000; } body { padding-top: 80px; }
<div class="top-center"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste après <body>
GAUCHE
.top-left { position: fixed; top: 20px; left: 20px; display: flex; gap: 10px; z-index: 1000; } body { padding-top: 80px; }
<div class="top-left"> <a href="index.html" class="btn-retour">🏠 Accueil</a> <a href="repertoire/index.html" class="btn-retour">📚 Répertoire</a> </div>
📍 Placer ce code juste après <body>
Position dans tous les cas de figure : .btn-retour Code CSS (fin <style>)
DROITE, CENTRE OU GAUCHE
.btn-retour { display: inline-block; padding: 12px 20px; background: #007BFF; color: white; text-decoration: none; border-radius: 8px; font-weight: 600; }
✅ RÈGLE CORRECTE :
- Boutons en HAUT : HTML juste après <body>
- Boutons en BAS : HTML juste avant </body>
- CSS pour tous les boutons : à la fin de la balise <style>
📝 Notes importantes :
1. Les émojis ont été mis à jour : 🏠 Accueil et 📚 Répertoire
2. Pour les boutons en haut, le padding-top: 80px; sur le body évite que le contenu soit caché
3. Le z-index: 1000 garantit que les boutons soient toujours visibles au-dessus du contenu
4. Vous pouvez ajuster les valeurs de position (20px) selon vos besoins