- WarRock France -
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment :
Jeux, jouets et Lego : le deuxième à ...
Voir le deal

(PHP), (CSS) Problème centrage du corps

3 participants

Aller en bas

(PHP), (CSS) Problème centrage du corps Empty (PHP), (CSS) Problème centrage du corps

Message par buzzleclair Dim 16 Jan - 11:53

J'arrive pas à ce que mon corps soit casé à droite de mon menu 0_0
J'ai mis mes pages à votre disposition : http://moncine.webuda.com/index.php
PHP:

Index :

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <link rel="stylesheet" media="screen" type="text/css" title="Design" href="style.css" />

  <head>
      <title>Mon-ciné.fr</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
   
  </head>
 
  <body>
 
      <!-- L'en-tête -->
       
      

      <?php include("menu-en-tete.php"); ?>
       
      <!-- Les menus -->
      
      <?php include("menu-gauche.php"); ?>
      
      <!-- Le corps -->
      
      <div id="corps">
      
      <?php
         try
         {
            $bdd = new PDO('mysql:host=localhost;dbname=test','root','');
         }
         catch(Exception $e)
         {
            die('Erreur :'.$e->getMessage());
         }
         if(empty($_GET['page']))
         {
         $id = 0;
         }
         else
         {
         $id = ($_GET['page'] - 1)*3;
         }
            $reponse = $bdd->query('SELECT id,titre,contenu,DATE_FORMAT(date_creation,'Le %d/%m/%Y à %Hh%imin%ss') AS date_creation_fr FROM billets ORDER BY id  DESC LIMIT '.$id.',3');
            while($donnees = $reponse->fetch())
            {
               
      ?>
            <div class= "news">
               <h3><?php echo htmlspecialchars($donnees['titre']). ' <em>'. $donnees['date_creation_fr'] . '</em>';?></h3>
               <p>   <?php echo htmlspecialchars($donnees['contenu']);?><br/>
                  <a href = "commentaires.php?billet_1=<?php echo htmlspecialchars($donnees['id']);?>"><em>Commentaires</em></a>
               </p>
            </div>
      <?php
            }
            $reponse->closeCursor();
      ?>
      <?php
         // Pagination Des Pages .....
            $req = $bdd->query('SELECT COUNT(*) AS nb_billet FROM billets');
            $donnees = $req->fetch();
            
            $rest = $donnees['nb_billet']%3;
            //On teste si le nb_billet est divisible par 3
            if($rest == 0)
            {
               $nb_pages = $donnees['nb_billet']/3;
               
            }
            //Sinon on ajoute 1 au quotion et on transforme le tout en valeur entiere
            else
            {
               $nb_pages = (int) ($donnees['nb_billet']/3 + 1);
               
            }
            //On fait une boucle aprés avoir obtenu le nb_pages exacte pour ensuite afficher les numéros de pages
            for($i=1;$i<= $nb_pages;$i++)
            {
      ?>
            
      <?php
         }
         $req->closeCursor();
      ?>
            
      </div>
            

<!-- Le pied de la page -->
 
  </body>
</html>

Menu gauche :

Code:


<ul id="menu">



         <li><a href="#accueil">Top ciné</a></li>
         <li><a href="#r1">Rubrique 2</a></li>
         <li><a href="#r2">Rubrique 2</a></li>
         <li><a href="#r3">Rubrique 3</a></li>
         <li><a href="#r4">Rubrique 4</a></li>   
      </ul>


CSS :

J'ai 4 parties :

>body
>menu horyzontale
>menu ( menu de gauche )
>corps
Code:



body
{
  width: 900px;
  margin: auto;
  margin-top: 20px;
  margin-bottom: 20px;   
  background-image: url("fond.png");
  font-family: Arial, "Arial Black", "Arial", Times, serif;
}

/* L'en-tête */

#en_tete
{
  width: 900px;
  height: 40px;
  background-image: url(".jpg");
  background-repeat: no-repeat;

    }
   
ul#menu_horizontal

{
width : 900px;
height : 30px;
margin : 2em 0 0 0;
padding : 0;
background-color : #f4f9fd;
border : 1px dashed black;
list-style-type : none;
}
 
ul#menu_horizontal li
{
padding : 0 0.5em; 
line-height : 30px;
}
 
ul#menu_horizontal li.bouton_gauche
 {
float : left;
border-right : 1px dashed black;
}
 
ul#menu_horizontal li.bouton_droite
{
float : right;
border-left : 1px dashed black;
}
 
ul#menu_horizontal a
 {
color : black;
text-decoration : none;
padding : 0 0.5em;
font :  0.8em "Trebuchet MS";
}
 
ul#menu_horizontal a:hover { text-decoration : underline; }
 
ul#menu_horizontal a img
 {
border : none;
padding :  0 0.3em;
}









ul#menu
{          
  margin-top:  10px
  margin    :  0;              /* Marge extérieur nulle */
  padding  :  1px 1px 0;      /* Marge intérieur à 1px sauf pour le bas */
  width    :  150px;          /* Largeur de notre liste */
  font-size :  1.2em;          /* Taille de notre police */

}

ul#menu li
{                   
  border            :  1px solid black; /* Ajout d'une bordure */
  list-style-type  :  none;            /* Aucunes puces associées */
  margin-bottom    :  1px;            /* Ajout d'une marge en bas du lien */
}

ul#menu li a
{
  width            :  auto !important;  /* Largeur interprétée par tous les navigateurs excepté IE6 et inférieur */                  

  padding          :  4px;              /* Définition des marges intérieures */ 
  text-decoration  :  none;              /* Suppression du soulignement */
  color            :  black;              /* Couleur de la police */
  display          :  block;            /* Définition sous forme de block */
  background-color  :  #f4f9fd;          /* Définition de la couleur de fond */
  border            :  1px solid #f4f9fd; /* Ajout d'une bordure */   
  border-left-width :  4px;              /* Modification de la bordure gauche */
}         
   

   
   #corps

{
   
    margin-top: 40px;
 
  width: 690px;
}
h1, h3
{
    text-align:center;
}
h3
{
    background-color:black;
    color:white;
    font-size:0.9em;
    margin-bottom:0px;
}
.news p
{
    background-color:#CCCCCC;
    margin-top:0px;
}
.news
{
    width:70%;
    margin:auto;
}

a
{
    text-decoration: none;
    color: blue;
}
 




buzzleclair
buzzleclair
Banni
Banni

Masculin
Nombre de messages : 305
Age : 30
Localisation : Nantes
Pseudo IG : lostichou
Level IG : (PHP), (CSS) Problème centrage du corps 035
Retail box : Aucune
Clan : ffs
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 31/12/2010

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par x¢яαzуzz Dim 16 Jan - 12:09

flaot: left
position:block

et margin left pour le corps

++
x¢яαzуzz
x¢яαzуzz
Membre
Membre

Masculin
Nombre de messages : 2453
Age : 31
Localisation : 44
Pseudo IG : xcrazyze
Level IG : (PHP), (CSS) Problème centrage du corps 014
Retail box : Aucune
Clan : Mafya GAMING
Premium : (PHP), (CSS) Problème centrage du corps Gold10
Date d'inscription : 01/11/2008

http://www.warrock-france.eu

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par buzzleclair Dim 16 Jan - 14:39

xcr4zyz' a écrit:
flaot: left
position:block

et margin left pour le corps

++

Merci mec
buzzleclair
buzzleclair
Banni
Banni

Masculin
Nombre de messages : 305
Age : 30
Localisation : Nantes
Pseudo IG : lostichou
Level IG : (PHP), (CSS) Problème centrage du corps 035
Retail box : Aucune
Clan : ffs
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 31/12/2010

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par buzzleclair Dim 16 Jan - 14:59

J'ai du merder quelque part.
Sa me donne sa au niveau du css : ( mais sa change rien )

Le menu :
Code:

ul#menu
{          
  margin-left : 0px
  flaot: left
  position: block
  margin-top:  10px
  margin    :  0;              /* Marge extérieur nulle */
  padding  :  1px 1px 0;      /* Marge intérieur à 1px sauf pour le bas */
  width    :  150px;          /* Largeur de notre liste */
  font-size :  1.2em;          /* Taille de notre police */

}

ul#menu li
{                   
  border            :  1px solid black; /* Ajout d'une bordure */
  list-style-type  :  none;            /* Aucunes puces associées */
  margin-bottom    :  1px;            /* Ajout d'une marge en bas du lien */
}

ul#menu li a
{
  width            :  auto !important;  /* Largeur interprétée par tous les navigateurs excepté IE6 et inférieur */                  

  padding          :  4px;              /* Définition des marges intérieures */ 
  text-decoration  :  none;              /* Suppression du soulignement */
  color            :  black;              /* Couleur de la police */
  display          :  block;            /* Définition sous forme de block */
  background-color  :  #f4f9fd;          /* Définition de la couleur de fond */
  border            :  1px solid #f4f9fd; /* Ajout d'une bordure */   
  border-left-width :  4px;              /* Modification de la bordure gauche */
}         

Le corps :

Code:


#corps

{
    flaot: left
    position: block
    margin-left : 200px
    margin-top: 0px;
 
  width: 600px;
}
h1, h3
{
    text-align:center;
}
h3
{
    background-color:black;
    color:white;
    font-size:0.9em;
    margin-bottom:0px;
}
.news p
{
    background-color:#CCCCCC;
    margin-top:0px;
}
.news
{
    width:70%;
    margin:auto;
}

a
{
    text-decoration: none;
    color: blue;
}

buzzleclair
buzzleclair
Banni
Banni

Masculin
Nombre de messages : 305
Age : 30
Localisation : Nantes
Pseudo IG : lostichou
Level IG : (PHP), (CSS) Problème centrage du corps 035
Retail box : Aucune
Clan : ffs
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 31/12/2010

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par Invité Dim 16 Jan - 15:16

float pas flaot
Anonymous
Invité
Invité


Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par x¢яαzуzz Dim 16 Jan - 15:20

Merde j'avais fait une faute de frappe. Au temps pour moi.

Et ton css.

A la fin de chaque instruction de ton id. Termine ton action !

Le point virgule !!!


Dernière édition par xcr4zyz' le Dim 16 Jan - 15:22, édité 1 fois
x¢яαzуzz
x¢яαzуzz
Membre
Membre

Masculin
Nombre de messages : 2453
Age : 31
Localisation : 44
Pseudo IG : xcrazyze
Level IG : (PHP), (CSS) Problème centrage du corps 014
Retail box : Aucune
Clan : Mafya GAMING
Premium : (PHP), (CSS) Problème centrage du corps Gold10
Date d'inscription : 01/11/2008

http://www.warrock-france.eu

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par buzzleclair Dim 16 Jan - 15:22

a merde en plus je l'avais vue --' j'ai changé de musique entre temps et j'ai complètement zappé
buzzleclair
buzzleclair
Banni
Banni

Masculin
Nombre de messages : 305
Age : 30
Localisation : Nantes
Pseudo IG : lostichou
Level IG : (PHP), (CSS) Problème centrage du corps 035
Retail box : Aucune
Clan : ffs
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 31/12/2010

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par buzzleclair Dim 16 Jan - 15:33

xcr4zyz' a écrit:

Le point virgule !!!

wep merci
buzzleclair
buzzleclair
Banni
Banni

Masculin
Nombre de messages : 305
Age : 30
Localisation : Nantes
Pseudo IG : lostichou
Level IG : (PHP), (CSS) Problème centrage du corps 035
Retail box : Aucune
Clan : ffs
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 31/12/2010

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par Azertyuiop Dim 16 Jan - 15:50

Nico' a écrit:float pas flaot

Ce sont les même float que dans le langage ada ?

C'est à dire les nombres décimaux ?

ou pas du tout
Azertyuiop
Azertyuiop
Membre
Membre

Masculin
Nombre de messages : 5430
Age : 31
Localisation : Toulouse
Pseudo IG : Ẳzєятуυισρ
Level IG : (PHP), (CSS) Problème centrage du corps 041
Retail box : AWM
Clan : French Swat /SakGe Gaming
Premium : (PHP), (CSS) Problème centrage du corps F2p10
Date d'inscription : 29/03/2009

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par x¢яαzуzz Dim 16 Jan - 18:36

Non pas du tout Very Happy
x¢яαzуzz
x¢яαzуzz
Membre
Membre

Masculin
Nombre de messages : 2453
Age : 31
Localisation : 44
Pseudo IG : xcrazyze
Level IG : (PHP), (CSS) Problème centrage du corps 014
Retail box : Aucune
Clan : Mafya GAMING
Premium : (PHP), (CSS) Problème centrage du corps Gold10
Date d'inscription : 01/11/2008

http://www.warrock-france.eu

Revenir en haut Aller en bas

(PHP), (CSS) Problème centrage du corps Empty Re: (PHP), (CSS) Problème centrage du corps

Message par Contenu sponsorisé


Contenu sponsorisé


Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum