Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Sauvegarder le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <head> <style> .container { position: relative; largeur: 100%; max-width: 600px; } .container img { largeur: 100%; hauteur: auto; } .container .btn { position: absolute; haut: 50%; gauche: 50%; transform: translate(-50%, -50%); couleur de fond: #f1f1f1; couleur: noir; taille de police: 16px; padding: 16px 30px; bordure: aucune; curseur: pointeur; border-radius: 5px; text-align: center; } .container .btn:hover { couleur-de-fond: noir; couleur: blanc; } </style> </head> <body> <h2>Bouton sur l'image</h2> <p>Ajouter un bouton au centre d'une image :</p> <div class="container"> <img src="img_lights.jpg" alt="Snow" width="600" height="400"> <button class="btn">Bouton</button> </div> </body> </html>