logo

Bienvenue sur breat.fr · Tutoriels !


ads

HTML/JS : faire un bouton pour changer de thème

Voici comment faire pour faire un bouton pour changer de thème avec un peu de javascript comme sur breat.fr et qui reste après un changement de page.


Il ne vous reste plus qu'à créer un 2ème fichier CSS en changeant background-color et color de body comme ceci :

                
                    body {
                        background-color: white;
                        color: black;
                        margin: auto;
                    }
                
            

Vous pouvez télécharger un exemple prêt à l'emploi ici.