Question sur différent type de bordure

Fermé
pamela - Modifié par pamela le 7/09/2015 à 21:48
 pamela - 7 sept. 2015 à 22:47
Bonjour,

je voudrais juste savoir coment écrit en css
enfin je mets des css et vous me direz qui est mieux
      .bordurcoterleft
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:0px 0px 0px 1px; /* top right bottom left */
   }

      .bordurcoterright
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:0px 1px 0px 0px; /* top right bottom left */
   }

      .bordurcoterleftright
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:0px 1px 0px 1px; /* top right bottom left */
   }

      .bordurcoterleftrighttop
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:1px 1px 0px 1px; /* top right bottom left */
   }
      .bordurcotertop
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:1px 0px px 0px; /* top right bottom left */
   }

      .bordurcoterbottom
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:0px 0px 1px 0px; /* top right bottom left */
   }

      .bordurcotertopbottom
   {
   border-color:#CCCCCC; /* on affiche la couleur de la bordure */
     border-style: solid; /*  on affiche le style de l'a bordure */
   border-width:0px 1px 0px 1px; /* top right bottom left */
   }

jje pense qu'on peut écrire come celà

      .bordurcoterleft
   {
   border-left:1px solid #CCCCCC; /* top right bottom left */
   }

      .bordurcoterright
   {
   border-right:1px solid #CCCCCC; /* top right bottom left */
   }

      .bordurcoterleftright
   {
   border-left:1px solid #CCCCCC; /* top right bottom left */
   border-right:1px solid #CCCCCC; /* top right bottom left */
   }

      .bordurcoterleftrighttop
   {
   border-left:1px solid #CCCCCC; /* top right bottom left */
   border-right:1px solid #CCCCCC; /* top right bottom left */
   border-top:1px solid #CCCCCC; /* top right bottom left */
   }
      .bordurcotertop
   {
   border-top:1px solid #CCCCCC; /* top right bottom left */
   }

      .bordurcoterbottom
   {
   border-bottom:1px solid #CCCCCC; /* top right bottom left */
   }

      .bordurcotertopbottom
   {
   border-bottom:1px solid #CCCCCC; /* top right bottom left */
   border-top:1px solid #CCCCCC; /* top right bottom left */
   }




afin de savoir qui est mieux



1 réponse

Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 427
7 sept. 2015 à 21:55
Salut, ça ne sert a rien de créer un style pour chaque coté de bordure si elles sont toutes identiques.
A mon avis un simple
.border{
border:1px solid #CCCCCC;
}

devrait suffire.
0
si je veux une bordure top et right

.bordurcotertopright
{
border-color:#CCCCCC; /* on affiche la couleur de la bordure */
border-style: solid; /* on affiche le style de l'a bordure */
border-width:1px 1px px 0px; /* top right bottom left */
}


ou

.bordurcotertopright
{
border-top:1px solid #CCCCCC; /* top right bottom left */
border-right:1px solid #CCCCCC; /* top right bottom left */
}
0