Le css ne marche pas
Résolu
Utilisateur anonyme
-
smed_79 Messages postés 1298 Date d'inscription Statut Contributeur Dernière intervention -
smed_79 Messages postés 1298 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
mon CSS ne marche pas, pouvez-vous m'aider ?
merci.
code css:
fieldset .information{
height : auto;
width : auto;
margin-left : 5px;
margin-right : 5px;
margin-top : 5px;
margin-bottom : 5px;
border : 1px solid #2d760a;
background: #2dd20a;
color: #2d760a;
border-radius : 6px;
-moz-border-radius : 6px;
-webkit-border-radius : 6px;
}
fieldset .information legend{
height : 50px;
width : 50px;
margin-left : auto;
margin-right : auto;
margin-top : auto;
margin-bottom : auto;
background:url(../images/information.png);
}
code html
<fieldset class="information">
<legend></legend>
ce message doit etre sur un fond vert
</fieldset>
mon CSS ne marche pas, pouvez-vous m'aider ?
merci.
code css:
fieldset .information{
height : auto;
width : auto;
margin-left : 5px;
margin-right : 5px;
margin-top : 5px;
margin-bottom : 5px;
border : 1px solid #2d760a;
background: #2dd20a;
color: #2d760a;
border-radius : 6px;
-moz-border-radius : 6px;
-webkit-border-radius : 6px;
}
fieldset .information legend{
height : 50px;
width : 50px;
margin-left : auto;
margin-right : auto;
margin-top : auto;
margin-bottom : auto;
background:url(../images/information.png);
}
code html
<fieldset class="information">
<legend></legend>
ce message doit etre sur un fond vert
</fieldset>
Configuration: Windows XP / Firefox 3.5.5
7 réponses
-
CSS Tutorial : https://www.w3schools.com/css/default.asp
voila votre code que j'ai modifier :<html> <head> <style type="text/css"> body { margin: 0 auto 0 auto; padding: 0; font-size: 12px; background: #fff; font-family: "Verdana", Lucida Grande, Tahoma, sans-serif; } .information{ margin : 5px; padding: 5px 5px 10px 5px; border : 1px solid #2d760a; background: #2dd20a; color: #2d760a; border-radius : 6px; -moz-border-radius : 6px; -webkit-border-radius : 6px; } .information legend{ padding: 2px; border : 1px dashed #ff0000; font-weight: bold; margin-left : auto; margin-right : auto; margin-top : auto; margin-bottom : auto; background: #74DF00; -moz-border-radius : 2px; -webkit-border-radius : 3px; } </style> </head> <body> <fieldset class="information"> <legend>Legend</legend> ce message doit etre sur un fond vert </fieldset> </body> </html>
-
As tu dit en haut de ta page d'insérer ton code CSS.
Entre les balises <head> et </head>:
<link rel="stylesheet" type="text/css" href="lienverstonfichier.CSS" />
-
Merc de ta reponse pinouf42, mais oui mon css est relié a la page , pour preuve mon design est respecté.
-
Et bien qu'est-ce qui ne marche pas dans ton CSS alors?
-
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question -
J'ai trouvé, le css dit d'appliquer le style à la class information se trouvant dans un fieldset
alors que le html c'est un fieldset class information, il faut donc remplacer : fieldset .information par fieldset.information -
Merci de marquer résolu (cocher la petite case en haut)
;) -