Hi, I haven’t touch CSS for months and I forgot what is the best way to make a form with a HTML like this ? I don’t like use many divs. Would you use flexbox or grid ? I’m asking as I will have to “re learn” one of them to be able to make my form in a short time and keep my html clean.
I want to be able to put my input next to my label or my label on the top of my input. Is it possible by using an HTML like this ?
Thanks
<div class="container">
<form>
<label for='prenom'>Prenom</label>
<input type='text' id='prenom' name='prenom'>
<label for='nom'>Nom</label>
<input type='text' id='nom' name='nom'>
<p>Vous etes :</p>
<input type="radio" id="homme" name="sexe" value="homme">
<label for="homme">Homme</label>
<input type="radio" id="femme" name="sexe" value="femme">
<label for="femme">Femme</label>
<p>Votre animal:</p>
<input type="checkbox" name="chien" id="chien">
<label for="chien">Chien</label>
<input type="checkbox" name="chat" id="chat">
<label for="chat">Chat</label>
</form>
</div>