Tom's Guide > Forum > Programmation > [Résolu]Footer en bas

[Résolu]Footer en bas

Forum Programmation : [Résolu]Footer en bas

TomsGuide.com : 800 000 inscrits répondent à toutes vos questions high-tech et informatique. Pour obtenir de l'aide, inscrivez-vous gratuitement !
Mot :    Pseudo :           
 

Salut,

Voilà mon problème : je suis en train de réaliser un site web et c'est assez classique quoi (Header en haut, menu à gauche, footer en bas, corps au milieu/droite) mais voilà quand je met dans le corps un contenu qui est plus petit que le menu qui est à droite, le footer reste en-dessous du corps et cela fait que le menu est décalé par rapport au footer et moi je veux qu'il s'aligne soit avec le corps/contenu quand c'est lui le plus long soit avec le menu si c'est lui le plus long. Vous m'avez compris ? J'espère :lol: J'ai essayé le hr, clear: both; ... mais rien n'y fait alors j'espère que cela est possible à faire et que vous savez et vous m'aiderais ^^

Un petit screenshot pour mieux voir : ICI

P.S.: Si vous voulez le code de ma page (XHTML et CSS), faites le moi savoir bien que je ne pense pas que cela soit utile mais on sait jamais


Message édité par StraightShooter le 09-09-2008 à 12:43:34
Liens sponsorisés
Inscrivez-vous ou connectez-vous pour masquer ceci.

bonsoir
as-tu réussi.sinon avec le code c'est mieux bien sûr.

Répondre à ideal23

Ok voici mon code :

Code :
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.   <title>Streaming & DDL : Contact</title> 
  5.   <link rel="stylesheet" type="text/css" href="style.css" /> 
  6. </head>   
  7. <body>
  8.   <div id="wrapper">
  9.       <div id="menu">
  10.         <ul>
  11.             <li><a href="index.php" title="Accueil">Accueil</a></li>
  12.             <li><a href="#" title="Mangas">Mangas</a></li>
  13.             <li><a href="#" title="Séries">Séries</a></li>
  14.             <li><a href="#" title="Films">Films</a></li>
  15.             <li><a href="#" title="Scans Mangas">Scans Mangas</a></li>
  16.         </ul>
  17.       </div>
  18.            
  19.       <div id="date"><?php echo 'Nous sommes le : ' . date('d/m/Y') . ' et il est : ' . date('H:i'); ?></div>
  20.            
  21.       <div id="header">       
  22.         <img src="images/header.png" alt="Header" />
  23.       </div>
  24.            
  25.       <div id="content">
  26.         <div id="menuleft">
  27.            
  28.             <h1>Espace Membre</h1>
  29.             <div style="margin-left:15px;">
  30.               <form method="post" action="#">
  31.                   <p>
  32.                   Votre Pseudo <br />
  33.                   <input type="text" name="pseudo" />
  34.                   </p>
  35.                  
  36.                   <p>
  37.                   Votre Mot de Passe <br />
  38.                   <input type="password" name="mdp" />
  39.                   </p><br />
  40.                   <p>
  41.                   Se souvenir de moi ? <br />
  42.                   <input type="checkbox" name="enregistrer_pseudo_mdp" />
  43.                   </p><br />
  44.                  
  45.                   <p>
  46.                   <input type="submit" value="Se connecter" />
  47.                   </p>
  48.                 </form>
  49.             </div>
  50.              
  51.         <br />
  52.        
  53.             <h1>Menu</h1>
  54.               <ul>
  55.                   <li><a href="#" title="News">News</a></li>
  56.                   <li><a href="#" title="Ajouter une vidéo">Ajouter une Vidéo</a></li>
  57.                   <li><a href="#" title="Staff">Staff</a></li>
  58.                   <li><a href="#" title="Recrutement">Recrutement</a></li>
  59.                   <li><a href="livredor/index.php" title="Livre d'or">Livre d'or</a></li>
  60.                   <li><a href="#" title="Tchat">ShoutBox (Chat)</a></li>
  61.                   <li><a href="contact.php" title="Contact">Nous Contacter</a></li>
  62.                   <li><a href="#" title="Affiliations">Affiliations</a></li>                 
  63.               </ul>
  64.              
  65.         <br /> 
  66.        
  67.             <h1>Newsletter</h1>
  68.             <div style="margin-left:15px;">
  69.               <form method="post" action="#">
  70.                   <p>
  71.                   Votre E-Mail <br />
  72.                   <input type="text" name="email" />
  73.                   </p><br />
  74.                  
  75.                   <p>
  76.                     <select name="pays" id="pays">
  77.                         <option value="inscription">Inscription</option>
  78.                         <option value="desincription">Désincription</option>
  79.                     </select>
  80.                   </p><br />
  81.                   <p>
  82.                   <input type="submit" value="Valider" />
  83.                   </p>
  84.                 </form>
  85.             </div>
  86.              
  87.         <br />
  88.             <h1>Top Sites</h1>
  89.               <ul>
  90.                   <li><a href="#" title="Streaming-Top">Streaming-Top</a></li>
  91.                   <li><a href="#" title="Weborama">Weborama</a></li>
  92.                   <li><a href="#" title="Root-Top">Root-Top</a></li>
  93.                   <li><a href="#" title="LeBest">LeBest</a></li>
  94.               </ul>
  95.         <br />
  96.             <h1>Stats</h1>
  97.               <ul>
  98.                   <li><?php
  99. $retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM stats WHERE ip=\'' . $_SERVER['REMOTE_ADDR'] . '\'');
  100. $donnees = mysql_fetch_array($retour);
  101. if ($donnees['nbre_entrees'] == 0)
  102. {
  103.     mysql_query('INSERT INTO stats VALUES(\'' . $_SERVER['REMOTE_ADDR'] . '\', ' . time() . ')');
  104. }
  105. else
  106. {
  107.     mysql_query('UPDATE stats SET timestamp=' . time() . ' WHERE ip=\'' . $_SERVER['REMOTE_ADDR'] . '\'');
  108. }
  109. $timestamp_5min = time() - (60 * 5);
  110. mysql_query('DELETE FROM stats WHERE timestamp < ' . $timestamp_5min);
  111. $retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM stats');
  112. $donnees = mysql_fetch_array($retour);
  113. echo '<p>' . $donnees['nbre_entrees'] . ' En ligne</p>';
  114. ?></li>
  115. <li><?php
  116. $retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM stats WHERE ip=\'' . $_SERVER['REMOTE_ADDR'] . '\'');
  117. $donnees = mysql_fetch_array($retour);
  118. if ($donnees['nbre_entrees'] == 0)
  119. {
  120.     mysql_query('INSERT INTO stats VALUES(\'' . $_SERVER['REMOTE_ADDR'] . '\', ' . time() . ')');
  121. }
  122. $retour = mysql_query('SELECT COUNT(*) AS nbre_entrees FROM stats');
  123. $donnees = mysql_fetch_array($retour);
  124. echo '<p>' . $donnees['nbre_entrees'] . ' Visiteurs<br />Depuis le 08/09/2008</p>';
  125. ?></li>
  126.               </ul>
  127.         </div>
  128.                
  129.         <div id="text">
  130.            
  131. <form method="post" action="mail.php">
  132. <h2 class="titre_corps">Nous contacter</h2>
  133. <p>
  134. Votre Email <br /><br />
  135. <input type="text" name="votremail" />
  136. </p>
  137. <br />
  138. <p>
  139. Objet <br /><br />
  140. <input type="text" name="objet" />
  141. </p>
  142. <br />
  143. <p>
  144. Votre message <br /><br />
  145. <textarea cols="66" rows="6" name="message"></textarea>
  146. </p>
  147. <br />
  148. <p>
  149. <input type="submit" value="Envoyer" />
  150. </p>
  151. </form>
  152.       </div>
  153.      
  154.       <div id="footer">
  155.         <p>© 2008 Tous droits Reservés - <a href="#">Streaming-DDL.com</a> - Design by <a href="http://www.xneoz.eu">XnEoZ</a> - Website By Straight Shooter<br /><br />
  156.             Partenaires : | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> |<br />
  157.             | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | <a href="#" title="">votresite.com</a> | | <a href="#" title="">votresite.com</a> |</p>
  158.       </div>
  159.     </div>
  160.     <p></p><br />
  161.   <p></p><br />
  162.   <p></p><br />
  163.   <p></p><br />
  164. </body>
  165. </html>



Et le CSS :

Code :
  1. /* ===========================================================
  2. Elements de Page =========================================== */
  3. * {
  4.     margin:0;
  5.     border:1;
  6.     padding:0;
  7. }
  8. html, body {
  9.     background-image:url(images/bg.png);
  10.     font-family:Verdana, Arial, sans-serif;
  11.     font-size:11px;
  12.     color:#000000;
  13. }
  14. ul, li {
  15.     list-style-type:none;
  16. }
  17. a {
  18.     text-decoration:none;
  19.     cursor:pointer;
  20.     color:#000000;
  21. }
  22. a:hover {
  23.     text-decoration:underline;
  24. }
  25. /* ===========================================================
  26. Structure ================================================== */
  27. #wrapper {
  28.     position:relative;
  29.     margin:8px auto;
  30.     width:855px;
  31. }
  32. #menu li {
  33.     background:url(images/menu_bg.png) no-repeat 0 0;
  34.     text-align:center;
  35.     margin-left:18px;
  36.     font-weight:bold;
  37.     padding-top:5px;
  38.     width:129px;
  39.     height:19px;
  40.     float:left;
  41. }
  42. #menu li:hover {
  43.     background:url(images/menu_bg_actif.png) no-repeat 0 0;
  44. }
  45. #menu .actif {
  46.     background:url(images/menu_bg_actif.png) no-repeat 0 0;
  47. }
  48. #menu a {
  49.     color:#ffffff;
  50. }
  51. #header {
  52.     height:162px;
  53.     width:100%;
  54. }
  55. #date{
  56.     position:absolute;
  57.     font-weight:bold;
  58.     color:#ffffff;
  59.     right:7px;
  60.     top:28px;
  61. }
  62. #content {
  63.     background:url(images/top_bg.png) no-repeat top;
  64.     background-color:#ffffff;
  65.     margin-top:30px;
  66.     padding:13px;
  67.     width:829px;
  68. }
  69. #nouveau {
  70.     background:url(images/nouveau.png) no-repeat 0 0;
  71.     margin-bottom:-15px;
  72.     text-align:center;
  73.     padding-top:40px;
  74.     height:229px;
  75.     width:189px;
  76. }
  77. #menuleft {
  78.     float:left;
  79.     font-weight: bold;
  80. }
  81. #menuleft h1{
  82.     background:url(images/title_menu_bg.png) no-repeat 0 0;
  83.     margin-bottom:5px;
  84.     text-align:center;
  85.     padding-top:5px;
  86.     margin-left:4px;
  87.     font-size:12px;
  88.     color:#ffffff;
  89.     width:176px;
  90.     height:21px;
  91. }
  92. #menuleft ul {
  93.     margin-left:12px;
  94. }
  95. #menuleft li {
  96.     background:url(images/puce.png) no-repeat 0 0;
  97.     padding-left:25px;
  98.     margin-top:7px;
  99. }
  100. #text {
  101.     margin-left:200px;
  102. }
  103. #text h2.titre_corps {
  104.     background:url(images/title_bg.png) no-repeat 0 0;
  105.     margin-bottom:8px;
  106.     text-align:center;
  107.     padding-top:5px;
  108.     font-size:12px;
  109.     color:#ffffff;
  110.     width:625px;
  111.     height:21px;
  112. }
  113. #footer {
  114.     clear: left;
  115.     background:url(images/footer.png) no-repeat 0 0;
  116.     text-align:center;
  117.     padding-top:15px;
  118.     font-weight:bold;
  119.     color:#ffffff;
  120.     height:100px;
  121.     width: 100%;
  122.     bottom:10px;
  123. }
  124. #footer a {
  125.     color:#ffffff;
  126. }
  127. .image_ajouts {
  128.   float: left;
  129.   width: 125px;
  130.   height: 152px;
  131.   margin-right: 10px;
  132.   border: 0;
  133. }
  134. .populaires {
  135.   width: 100%;
  136. }
  137. .titre_tableau {
  138.   font-weight: bold;
  139.   text-align: center;
  140.   font-family: "Times New Roman", Arial, sans-serif;
  141.   color: #000000;
  142.   font-size:15px;
  143.   padding-bottom: 10px;
  144. }
  145. .titre_tableau a:hover {
  146.   text-decoration: none;
  147. .msfsm_tableau {
  148.   text-align: center;
  149.   font-family: Arial, sans-serif;
  150.   color: #000000;
  151.   padding-bottom: 2px;
  152. }
  153. .msfsm_tableau a:hover {
  154.   text-decoration: none;
  155. .titre_da {
  156.   text-align: center;
  157.   color: #000000;
  158.   font-family: "Times New Roman", "Comic Sans MS", Arial, sans-serif;
  159. }

Répondre à StraightShooter

salut,
Je ne sais pas si ton clear:left est efficace, essai de mettre un <div style="clear:both"></div> juste au dessus de ton footer

 

un tres bon tutorial : http://css.alsacreations.com/Model [...] age-en-CSS


Message édité par tracks@idn le 09-09-2008 à 10:59:42
Répondre à tracks@idn

Voilà merci beaucoup cela fonctionne ! Résolu !

Répondre à StraightShooter
Tom's Guide > Forum > Programmation > [Résolu]Footer en bas
Aller à :

Il y a 2164 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici.

Attention

Vous allez répondre sur un sujet resté inactif pendant plus de 6 mois.
Assurez-vous d'apporter des éléments nouveaux à la discussion avant de poursuivre.

Répondre Annuler
Liens