WEBLEB
Início
Editor
Entrar
Pro
Português
English
Français
Español
Português
Deutsch
Italiano
हिंदी
mudar de cor
989
mambetov1237.b
Abrir no Editor
Publique Seu Código
Recomendado
29 June 2025
Power Gym: Modelo HTML de condicionamento físico, treinamento e aulas
28 August 2025
Modelo HTML para aplicativo de streaming de música com Tailwind
16 April 2025
Um código de anhtuanle2004yst
HTML
Copy
HELLO
Bienvenue sur mon site web!
Changer la couleur,
press twice
CSS
Copy
body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; flex-direction: column; } h1 { color: white; /* color: #4caf50; */ font-size: 3rem; margin-bottom: 20px; } p { color: white; /* color: #ffd700; */ font-size: 1.5rem; } button { background-color: #4caf50; color: white; border: none; padding: 10px 20px; font-size: 1rem; cursor: pointer; margin-top: 20px; }<!-- Replace with your HTML Code (Leave empty if not needed) -->
JS
Copy
function changeColor() { const body = document.body; const h1 = document.querySelector("h1"); const p = document.querySelector("p"); if (body.style.backgroundColor === "rgb(244, 244, 244)") { body.style.backgroundColor = "#FFD700"; h1.style.color = "#4caf50"; p.style.color = "#4caf50"; } else { body.style.backgroundColor = "#f4f4f4"; h1.style.color = "#white"; p.style.color = "#white"; } }/* Replace with your JS Code (Leave empty if not needed) */