Ccs; probleme espace vertical entre 2 blocs

Bonjour,
j'aimerais pouvoir mettre un espace entre mon bloc baniere et mon bloc menu qui peut m'aider?
voici mon code html:

<!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" xml:lang="fr" >
<head>
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="design.css"/>
<title>Bienvenue sur mon site !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div id="banniere"></div>
<div id="menu"></div>
</body>

</html>

et mon code ccs:
body
{
width:780 px;
margin: 0 auto;
padding: 0px;
background-image: url("image de fond site.jpg");
text-align:center;
}

#banniere
{
background:url("banniere2.png");
width: 719px;
height: 146px;
background-repeat: no-repeat;
margin-top: 20px;
top:20px;
margin: auto;
position:relative;

}
#menu
{
background:url("menu.png");
width: 444px;
height: 28px;
background-repeat: no-repeat;
padding: 20px;
margin: auto;
text-align:center;
position:relative;
}
Configuration: Windows XP Internet Explorer 7.0

4 réponses

  • Votes
  • Date
  • Date décroissante
  1. et mon code ccs:
    body
    {
    width:780 px;
    margin: 0 auto;
    padding: 0px;
    background-image: url("image de fond site.jpg");
    text-align:center;
    }

    #banniere
    {
    background:url("banniere2.png");
    width: 719px;
    height: 146px;
    background-repeat: no-repeat;
    margin-top: 20px;
    top:20px;
    margin: auto;
    position:relative;

    }
    #menu
    {
    background:url("menu.png");
    width: 444px;
    height: 28px;
    background-repeat: no-repeat;
    padding: 20px;
    margin: auto; Remplacer cette instruction par margin-top:10px; 10px d'espace entre les deux bloc par exemple

    text-align:center;
    position:relative;
    }
    1. j'ai essayé comme ceci et ma barre menu est décalée vert la gauche et je voudrais la positioner sous ma banniere avec un espace entre les 2 merci.

      #banniere
      {
      background:url("banniere2.png");
      width: 719px;
      height: 146px;
      background-repeat: no-repeat;

      top:20px;
      margin: auto;
      position:relative;

      }
      #menu
      {
      background:url("menu.png");
      width: 444px;
      height: 28px;
      background-repeat: no-repeat;

      margin-top: 10px;
      text-align:center;
      position:relative;
      }
      1. exuse moi je n'ai pas la,
        alors essayer comme ca, j'ai testé ca et ca marche
        #banniere
        {
        background:url("banniere2.png");
        width: 719px;
        height: 146px;
        background-repeat: no-repeat;

        top:20px;
        margin: auto;
        position:relative;

        }
        #menu
        {
        background:url("menu.png");
        width: 444px;
        height: 28px;
        background-repeat: no-repeat;
        margin:40px auto auto;
        text-align:center;
        position:relative;
        }