
Aujourd’hui j’ai fait quelque petits tests des propriétés CSS3 et c’est fou ce que l’on peut faire avec !
Voyez par vous-même le formulaire généré :
Formulaire CSS3 sans images
(En passant si vous voulez récupérer ce formulaire css3 pour votre site web, vous pouvez c’est aussi là pour ça).
Les propriétés CSS 3 utilisées sont :
- border-radius : Permet d’avoir des bords arrondis.
- box-shadow : Permet de créer des ombres sur des blocs html
- text-shadow : Permet de créer des ombres sur du texte
les préfixes -moz-, -webkit-,-o- et –ms- permettent une compatibilité sur tous les navigateurs en attendant que le CSS 3 soit totalement reconnu.
Voici ci-dessous le code complet.
CSS :
-
-
.form1 *{padding:0;margin:0;}
-
-
.form1{
-
font-family:helvetica;
-
font-size:12pt;
-
width:320px;
-
margin:auto;
-
height:130px;
-
padding:20px;
-
border-radius:10px;
-
box-shadow: 1px 0px 10px #ccc;
-
background: rgb(234,234,234); /* Old browsers */
-
background: -moz-linear-gradient(top, rgba(234,234,234,1) 0%, rgba(255,255,255,1) 11%, rgba(255,255,255,1) 68%, rgba(232,232,232,1) 100%); /* FF3.6+ */
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(234,234,234,1)), color-stop(11%,rgba(255,255,255,1)), color-stop(68%,rgba(255,255,255,1)), color-stop(100%,rgba(232,232,232,1))); /* Chrome,Safari4+ */
-
background: -webkit-linear-gradient(top, rgba(234,234,234,1) 0%,rgba(255,255,255,1) 11%,rgba(255,255,255,1) 68%,rgba(232,232,232,1) 100%); /* Chrome10+,Safari5.1+ */
-
background: -o-linear-gradient(top, rgba(234,234,234,1) 0%,rgba(255,255,255,1) 11%,rgba(255,255,255,1) 68%,rgba(232,232,232,1) 100%); /* Opera 11.10+ */
-
background: -ms-linear-gradient(top, rgba(234,234,234,1) 0%,rgba(255,255,255,1) 11%,rgba(255,255,255,1) 68%,rgba(232,232,232,1) 100%); /* IE10+ */
-
background: linear-gradient(top, rgba(234,234,234,1) 0%,rgba(255,255,255,1) 11%,rgba(255,255,255,1) 68%,rgba(232,232,232,1) 100%); /* W3C */
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‘#eaeaea’, endColorstr=‘#e8e8e8′,GradientType=0 ); /* IE6-9 */
-
}
-
.form1 h2{
-
font-family:helvetica;
-
font-size:14pt;
-
color:#000;
-
margin-bottom:10px;
-
text-shadow: 1px 1px 2px #aaa;
-
font-weight:normal;
-
}
-
.form1 div{
-
margin-bottom:10px;
-
}
-
.form1 label{
-
display:inline-block;
-
-
background: #7abcff; /* Old browsers */
-
background: -moz-linear-gradient(top, #7abcff 0%, #4096ee 100%); /* FF3.6+ */
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7abcff), color-stop(100%,#4096ee)); /* Chrome,Safari4+ */
-
background: -webkit-linear-gradient(top, #7abcff 0%,#4096ee 100%); /* Chrome10+,Safari5.1+ */
-
background: -o-linear-gradient(top, #7abcff 0%,#4096ee 100%); /* Opera 11.10+ */
-
background: -ms-linear-gradient(top, #7abcff 0%,#4096ee 100%); /* IE10+ */
-
background: linear-gradient(top, #7abcff 0%,#4096ee 100%); /* W3C */
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‘#7abcff’, endColorstr=‘#4096ee’,GradientType=0 ); /* IE6-9 */
-
-
width:80px;
-
height:25px;
-
line-height:25px;
-
padding-left:20px;
-
color:#fff;
-
-
text-shadow: 1px 1px 1px #ddd;
-
border-top-left-radius:7px 4px;
-
border-bottom-left-radius:7px 4px;
-
}
-
.form1 input{
-
display:inline-block;
-
-
width:200px;
-
height:25px;
-
color:#333;
-
padding-left:20px;
-
border:0px solid #09f;
-
background-color:#C4E1FF;
-
border-left:0;
-
padding:0;
-
font-size:12pt;
-
border-top-right-radius:10px 5px;
-
border-bottom-right-radius:10px 5px;
-
outline:none;
-
}
-
-
.form1 div:hover input,.form1 div:hover label{
-
-
outline:none;
-
-
-
box-shadow:0px 0px 3px #09f;
-
-
}
-
.form1 input[type="submit"]{
-
display:block;
-
float:right;
-
background: rgb(213,206,166); /* Old browsers */
-
background: -moz-linear-gradient(top, rgba(213,206,166,1) 0%, rgba(201,193,144,1) 40%, rgba(183,173,112,1) 100%); /* FF3.6+ */
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(213,206,166,1)), color-stop(40%,rgba(201,193,144,1)), color-stop(100%,rgba(183,173,112,1))); /* Chrome,Safari4+ */
-
background: -webkit-linear-gradient(top, rgba(213,206,166,1) 0%,rgba(201,193,144,1) 40%,rgba(183,173,112,1) 100%); /* Chrome10+,Safari5.1+ */
-
background: -o-linear-gradient(top, rgba(213,206,166,1) 0%,rgba(201,193,144,1) 40%,rgba(183,173,112,1) 100%); /* Opera 11.10+ */
-
background: -ms-linear-gradient(top, rgba(213,206,166,1) 0%,rgba(201,193,144,1) 40%,rgba(183,173,112,1) 100%); /* IE10+ */
-
background: linear-gradient(top, rgba(213,206,166,1) 0%,rgba(201,193,144,1) 40%,rgba(183,173,112,1) 100%); /* W3C */
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‘#d5cea6′, endColorstr=‘#b7ad70′,GradientType=0 ); /* IE6-9 */
-
-
width:100px;
-
height:25px;
-
line-height:25px;
-
color:#fff;
-
text-align:center;
-
cursor:pointer
-
border-radius:0;
-
border-top-left-radius:10px;
-
border-bottom-right-radius:10px;
-
margin-right:20px;
-
}
-
.form1 input[type="submit"]:hover{
-
background: rgb(211,196,107); /* Old browsers */
-
background: -moz-linear-gradient(top, rgba(211,196,107,1) 1%, rgba(198,185,111,1) 40%, rgba(181,160,41,1) 100%); /* FF3.6+ */
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgba(211,196,107,1)), color-stop(40%,rgba(198,185,111,1)), color-stop(100%,rgba(181,160,41,1))); /* Chrome,Safari4+ */
-
background: -webkit-linear-gradient(top, rgba(211,196,107,1) 1%,rgba(198,185,111,1) 40%,rgba(181,160,41,1) 100%); /* Chrome10+,Safari5.1+ */
-
background: -o-linear-gradient(top, rgba(211,196,107,1) 1%,rgba(198,185,111,1) 40%,rgba(181,160,41,1) 100%); /* Opera 11.10+ */
-
background: -ms-linear-gradient(top, rgba(211,196,107,1) 1%,rgba(198,185,111,1) 40%,rgba(181,160,41,1) 100%); /* IE10+ */
-
background: linear-gradient(top, rgba(211,196,107,1) 1%,rgba(198,185,111,1) 40%,rgba(181,160,41,1) 100%); /* W3C */
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=‘#d3c46b’, endColorstr=‘#b5a029′,GradientType=0 ); /* IE6-9 */
-
cursor:pointer;
-
}
-
Et pour ce qui est du html :
-
-
<form class="form1">
-
<h2>Identification</h2>
-
<div>
-
<label for="f1Llogin"> Pseudo </label><input type="text" class="f1Llogin" />
-
</div>
-
<div>
-
<label for="f1Lpass"> Email </label><input type="password" class="f1Lpass" />
-
</div>
-
<input type="submit" value="valider" />
-
-
</form>
-
-
Publié dans Ressources
Bonjour et merci pour votre visite !
Commentaires récents