par
Cyrano » 02 juil. 2005, 09:52
Bon, j'ai eu un peu de mal mais je l'ai eu, ça marche avec Firefox, IE6 et même Opera: Je te mets le conde complet, tu compareras avec ton propre code pour noter les ajouts/modification/suppressions. Note également que ce qui ne facilite pas le positionnement de chaque coin, c'est le découpage de tes images de coins, mais c'est secondaire:
Le code HTML, j'y ai rajouté un id dans le div de contenu:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Accueil
</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<div id="content">
<div class="feature">
<h2>
Accueil
</h2>
</div>
<div class="feature">
<h3>
Zone erreur
</h3>
</div>
<div class="feature" id="cadre">
<div id="hautdroit"></div><div id="hautgauche"></div>
<div id="contenu">
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
</div>
<div id="basdroit"></div><div id="basgauche"></div>
</div>
</div>
</body>
</html>
La feuille de style CSS :
Code : Tout sélectionner
body{
font-family: Arial, sans-serif;
margin: 0em;
padding-bottom: 0em;
font-size: 62.5%;
}
h1, h2, h3, h4, h5, h6 {
font-family: Arial,sans-serif;
margin: 0px;
padding: 0px;
}
h2{
font-size:1.5em;
letter-spacing: 1px;
}
h3{
font-size:1.25em;
letter-spacing: 1px;
font-weight: normal;
color: #E90000;
}
#content{
float: left;
width: 80%;
margin-bottom: 13px;
margin-top: 0px;
padding-top: 0.5em;
padding-left: 3px;
padding-right: 3px;
margin-right: 0px;
margin-left: 0px;
font-size:1.2em;
position: absolute;
top: 4.6em;
left: 10em;
background-color: #eff0fb;
}
.feature{
border: 1px solid #a4a4e7;
background-color: #F5F8FF;
text-align: justify;
padding-left: 7px;
margin-bottom: 7px;
margin-top: 0px;
margin-right: 0px;
margin-left: 0px;
padding-top: 3px;
padding-right: 7px;
padding-bottom: 3px;
}
.feature #contenu{
margin-left: 1.5em;
}
#cadre {
padding: 0;
}
/* propriétés communes à l'ensemble des 4 coins */
#hautgauche, #hautdroit, #basgauche, #basdroit {
height: 20px; width: 20px;
background-repeat: no-repeat;
margin: 0;
font-size:1px; /* correction d'un bug IE */
}
/* propriétés spécifiques à chaque coin */
#hautgauche {
background-image: url(haut-gauche.gif);
position: relative;
top: -6px;
left: -2px
}
#hautdroit {
float: right;
background-image: url(haut-droit.gif);
position: relative;
top: -3px;
right: -1px
}
#basgauche {
background-image: url(bas-gauche.gif);
position: relative;
bottom: -2px;
left: -3px
}
#basdroit {
float: right;
background-image: url(bas-droit.gif);
position: relative;
bottom: -4px;
right: -4px
}
Bon, j'ai eu un peu de mal mais je l'ai eu, ça marche avec Firefox, IE6 et même Opera: Je te mets le conde complet, tu compareras avec ton propre code pour noter les ajouts/modification/suppressions. Note également que ce qui ne facilite pas le positionnement de chaque coin, c'est le découpage de tes images de coins, mais c'est secondaire:
Le code HTML, j'y ai rajouté un id dans le div de contenu:
[php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Accueil
</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<div id="content">
<div class="feature">
<h2>
Accueil
</h2>
</div>
<div class="feature">
<h3>
Zone erreur
</h3>
</div>
<div class="feature" id="cadre">
<div id="hautdroit"></div><div id="hautgauche"></div>
<div id="contenu">
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
Test.<br />
</div>
<div id="basdroit"></div><div id="basgauche"></div>
</div>
</div>
</body>
</html>
[/php]
La feuille de style CSS :
[code]body{
font-family: Arial, sans-serif;
margin: 0em;
padding-bottom: 0em;
font-size: 62.5%;
}
h1, h2, h3, h4, h5, h6 {
font-family: Arial,sans-serif;
margin: 0px;
padding: 0px;
}
h2{
font-size:1.5em;
letter-spacing: 1px;
}
h3{
font-size:1.25em;
letter-spacing: 1px;
font-weight: normal;
color: #E90000;
}
#content{
float: left;
width: 80%;
margin-bottom: 13px;
margin-top: 0px;
padding-top: 0.5em;
padding-left: 3px;
padding-right: 3px;
margin-right: 0px;
margin-left: 0px;
font-size:1.2em;
position: absolute;
top: 4.6em;
left: 10em;
background-color: #eff0fb;
}
.feature{
border: 1px solid #a4a4e7;
background-color: #F5F8FF;
text-align: justify;
padding-left: 7px;
margin-bottom: 7px;
margin-top: 0px;
margin-right: 0px;
margin-left: 0px;
padding-top: 3px;
padding-right: 7px;
padding-bottom: 3px;
}
.feature #contenu{
margin-left: 1.5em;
}
#cadre {
padding: 0;
}
/* propriétés communes à l'ensemble des 4 coins */
#hautgauche, #hautdroit, #basgauche, #basdroit {
height: 20px; width: 20px;
background-repeat: no-repeat;
margin: 0;
font-size:1px; /* correction d'un bug IE */
}
/* propriétés spécifiques à chaque coin */
#hautgauche {
background-image: url(haut-gauche.gif);
position: relative;
top: -6px;
left: -2px
}
#hautdroit {
float: right;
background-image: url(haut-droit.gif);
position: relative;
top: -3px;
right: -1px
}
#basgauche {
background-image: url(bas-gauche.gif);
position: relative;
bottom: -2px;
left: -3px
}
#basdroit {
float: right;
background-image: url(bas-droit.gif);
position: relative;
bottom: -4px;
right: -4px
}[/code]