gpt-4o-2024-05-13· OpenAI WildChat-4.8M (AI2)
fait moi une page d'informations en html, css et js
- User
user: fait moi une page d'informations en html, css et js
- Assistant
Bien sûr ! Voici un exemple de page web simple utilisant HTML, CSS et JavaScript. Cette page affichera un titre, une description, et un bouton. Lorsque vous cliquez sur le bouton, un message d'alerte apparaîtra.
HTML (index.html)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Page d'Informations</title> <link rel="stylesheet" href="styles.css"> <script defer src="script.js"></script> </head> <body> <div class="container"> <h1>Bienvenue sur ma Page d'Informations</h1> <p>Cette page fournit des informations utiles sur divers sujets intéressants.</p> <button id="infoButton">Cliquez pour plus d'infos</button> </div> </body> </html>CSS (styles.css)
body { font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #f0f0f0; } .container { text-align: center; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } h1 { color: #333; } button { padding: 10px 20px; font-size: 16px; margin-top: 10px; border: none; border-radius: 5px; background-color: #007BFF; color: #fff; cursor: pointer; } button:hover { background-color: #0056b3; }JavaScript (script.js)
document.getElementById('infoButton').addEventListener('click', () => { alert("Voici quelques informations supplémentaires !"); });Structure des fichiers
Assurez-vous que les fichiers sont structurés de cette manière :
votre-dossier-projet/ │ ├── index.html ├── styles.css └── script.jsInstructions pour l'exécution
- Sauvegardez le code fourni dans les fichiers respectifs (
index.html,styles.css,script.js). - Ouvrez
index.htmldans un navigateur web.
Cela devrait afficher une page avec un titre, une description et un bouton. Lorsque vous cliquez sur le bouton, une alerte avec un message s'affichera.
- Sauvegardez le code fourni dans les fichiers respectifs (