Avoir des labels flottants

Avoir les labels de votre formulaire flotté au focus d'un champ

Language: CSS

Catégorie : Formulaire

Favicon de Justa
<style>
 input:focus~.label-flottant,
 input:not(:focus):valid~.label-flottant,
 input[type=email]:not(:placeholder-shown)~.label-flottant {
   top: 5px;
   font-size: 12px;
 }

 .input:focus {
   outline: none;
 }
</style>
Sommaire
1
Le script

Utiliser un LLM pour résumer ou expliquer ce script

1

Le script

Ajouter le script sur la page ou le projet Webflow

<style>
 input:focus~.label-flottant,
 input:not(:focus):valid~.label-flottant,
 input[type=email]:not(:placeholder-shown)~.label-flottant {
   top: 5px;
   font-size: 12px;
 }

 .input:focus {
   outline: none;
 }
</style>
2

Les attributes

3

Tuto

4

Template

5

Code source du script

<style>
 input:focus~.label-flottant,
 input:not(:focus):valid~.label-flottant,
 input[type=email]:not(:placeholder-shown)~.label-flottant {
   top: 5px;
   font-size: 12px;
 }

 .input:focus {
   outline: none;
 }
</style>

Je veux lancer mon projet avec Justa

Nous contacter