|
|
|
|
Bonjour à tous,
Je rencontre un problème actuellement, j'ai une image que je désires centrer au milieu de ma page web, et qu'elle se situe tout en haut du site et non au centre (c'est une image background).
En ce moment, l'image se situe au centre au niveau Vertical et Horizontal.
Voici mon code :
#cadre_general
{
width: 1024px;
height: 768px;
font-family: Times New Roman;
}
#cadre_back
{
height: 1024px;
background-image:url(image/background.jpg);
background-attachment: fixed;
background-position : center;
background-repeat: no-repeat;
float: top;
}Il ne faut pas la mettre dans un <div></div>
body
{
height: 1024px;
background-image:url(image/background.jpg);
background-attachment: fixed;
background-position : center;
background-repeat: no-repeat;
float: top;
}
Voilà , bonne journée. On peut tromper 1 fois 1000 personnes, mais on ne peut pas tromper 1000 fois 1 personne. |
Au temps pour moi , en fait c'est :
|
Cela ne fonctionne toujours pas :(, je vous envoie le CSS complet :
#cadre_general
{
width: 1024px;
height: 768px;
font-family: Times New Roman;
color: white;
}
#Header
{
width: 100%;
height: 30%;
float: top;
}
#Gauche
{
width: 20%;
height: 70%;
margin-top: 0%;
text-align: center;
float: left;
}
#cadre_back
{
background-image:url(image/background.jpg);
background-attachment: fixed;
background-position : center;
background-repeat: no-repeat;
height: 1024px;
}
#Content
{
width: 80%;
height: 70%;
margin-top: 0%;
text-align: left;
float: right;
overflow: auto;
}
body
{
background-color: #000000;
}
L'ordre des <div> dans les pages web sont : - body - cadre_back - cadre_general - Header - Gauche - Content Voila en espérant que ça ai pu vous aider :) |
Problème résolu, on continuant de chercher sur des sites je suis tombé sur le "background-position" que j'utilisais déjà. Mais apparemment on délimite la position vertical et horizontal avec cette balise.
#cadre_back
{
background-image:url(image/background.jpg);
background-attachment: fixed;
background-position : center top;
background-repeat: no-repeat;
height: 1024px;
}
Merci beaucoup pour ta patience et tes recherche godLike ;). Bonne journée. |