JSFiddle - React, Tailwind, and code Playground
HTML
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"/> -->
<title>Formulaire P 208 html css</title>
<style>
#accord:checked + label {
background-color: gold;
font-weight: bold;
}
#homme:checked + label, #femme:checked + label {
font-style: italic;
}
:enabled {
background-color: lightgreen;
}
:disabled {
background-color: lightcoral;
}
/* Bouton */
.styled {
border: 0;
line-height: 2.5;
padding: 0 20px;
font-size: 1rem;
text-align: center;
color: #fff;
text-shadow: 1px 1px 1px #000;
border-radius: 6px;
background-color: rgba(220, 0, 0, 1);
background-image: linear-gradient(to top left, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2) 30%, rgba(0, 0, 0, 0));
box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.6), inset -2px -2px 3px rgba(0, 0, 0, 0.6);
}
.styled:hover {
background-color: rgba(255, 0, 0, 1);
}
.styled:active {
box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.6);
}
</style>
</head>
<body>
<fieldset>
<form id="form1" method="#" action="#">
<p>
<label for="nom">Votre nom : </label>
<input type="text" id="nom" required />
</p>
<p>
<label for="naiss">Votre année<br> de naissance : </label>
<input type="number" max="2500" maxlength="4" step="1" value="1900" id="naiss" />
</p>
<p>
<label for="age">Votre âge : </label>
<input type="text" id="age" disabled="disabled" /> <!-- Rend le champ inopérant -->
</p>
<p>
<input type="radio" name="sexe" id="homme" value="Homme" />
<label for="homme">Homme</label><br>
<input type="radio" name="sexe" id="femme" value="Femme" />
<label for="femme">Femme</label>
</p>
<p>
<input type="checkbox" id="accord" required />
<label for="accord">J'accepte le réglement</label>
</p>
<input type="submit" class="favorite styled" name="envoi" id="envoi" value="Envoyer"/>
<form method="#"...