work without css

This commit is contained in:
2025-03-07 22:22:50 +01:00
parent 86363d4c2f
commit cc64d3012a
6 changed files with 153 additions and 68 deletions

View File

@ -1,55 +0,0 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dropdown Button</title>
<style>
/* Style du bouton */
.dropdown-btn {
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
font-size: 16px;
border-radius: 5px;
display: inline-block;
}
/* Cacher le radio (pour qu'il ne soit pas visible) */
.dropdown-radio {
display: none;
}
/* Style du texte qui apparaît lorsque la case est cochée */
.dropdown-text {
display: none;
margin-top: 10px;
padding: 10px;
background-color: #f1f1f1;
border: 1px solid #ddd;
border-radius: 5px;
}
/* Quand le radio est sélectionné, afficher le texte */
.dropdown-radio:checked + .dropdown-btn + .dropdown-text {
display: block;
}
</style>
</head>
<body>
<!-- Radio caché qui contrôle l'affichage du texte -->
<input type="radio" id="dropdown" class="dropdown-radio" name="dropdown-group">
<!-- Bouton -->
<label for="dropdown" class="dropdown-btn">Afficher le texte</label>
<!-- Texte qui se déploie -->
<div class="dropdown-text">
Voici le texte qui se déploie quand on clique sur le bouton.
</div>
</body>
</html>