Partage
  • Partager sur Facebook
  • Partager sur Twitter

problème de date

je la met où :p

Sujet résolu
Anonyme
    12 juillet 2006 à 17:04:38

    Bonjour les Zéros,

    je ne sais pas si mon topic est bien placée, il concerne le CSS et le PHP...

    j'ai un problème :

    Quand je creer une news grâce a la BDD, la date se met juste après mon titre, mais je voudrais la mettre en haut a gauche de mon cadre, et quand je le fait, le problème que j'ai, c'est qu'elle n'est pas à la même place pour toute les news, elle varie de droite a gauche en fonction de la news, alors que la largeur reste identique.

    Si quelqu'un comprend mon sujet ... :p
    • Partager sur Facebook
    • Partager sur Twitter
    Anonyme
      12 juillet 2006 à 17:33:51

      mon code CSS ?
      ou HTML ?
      ou PHP ??
      • Partager sur Facebook
      • Partager sur Twitter
        12 juillet 2006 à 17:45:44

        css et html (source de ta page)
        • Partager sur Facebook
        • Partager sur Twitter
        Anonyme
          12 juillet 2006 à 17:56:20

          <!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="Exemple" href="RedZapple.css"/>
                 <title>Bienvenue sur RedZapple !</title>
                 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
              </head>
              <body>
                  <div id="en_tete">
                                  <img src="logo_tete.bmp" alt="studio RedZapple" />
                      </div>
                          <table>
                          <tr>
                                  <td> <a href="index.php">Accueil</a> </td>
                                  <td> <a href="livre_d_or.php">Livre D'or</a> </td>
                          </tr>
                          </table>
                          <div id="menu">
                                  <div class="element_menu">
                                  <img class="logo_menu" src="logo_menu2.jpg" alt="menu"/>
                                          <ul>
                                                  <li><a href="redzapple_c_quoi.html">RedZapple c'est quoi ?</a></li><br/>
                                                  <li><a href="projets_en_cours.html">les projets en cours</a></li><br/>
                                                  <li><a href="projets_a_venir.html">les projets à venir</a> </li><br/>
                                                  <li><a href="fiches_de_films.html">fiches de films </a></li><br/>
                                                  <li><a href="archives.html">archives </a></li><br/>
                                                  <li><a href="galerie.html">galeries photos </a></li><br/>
                                                  <li><a href="liens.html">liens utiles et/ou sympas</a></li>
                                          </ul>
                                  </div> 
                          </div>
                      <img class="img" src="bouton_news.jpg" alt="news"/>
                    
                         
          <?php
          mysql_connect("localhost", "root", "");
          mysql_select_db("test");

          // On récupère les 5 dernières news
          $retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0, 5');
          while ($donnees = mysql_fetch_array($retour))
          {
          ?>

            <div id="corps">
              <h2>
                  <?php echo $donnees['titre']; ?>
              <span class="em">le <?php echo date('d/m/Y à H\hi', $donnees['timestamp']); ?> <span class="em">
              </h2>
                  </p>
                  <p>   
           
              <?php
              // On enlève les éventuels antislash PUIS on crée les entrées en HTML (<br />
          )
              $contenu = nl2br(stripslashes($donnees['contenu']));
              echo $contenu;
              ?>
              </p>
          </div>
          </div>
          <?php
          } // Fin de la boucle des news
          ?>

                         
                      <div id="pied">
                                  <p> Copyright "RedZapple" 2006,tous droits reservés <br/>
                                   Pour contacter <a href="mailto:equiperedzapple@yahoo.fr">l'équipe </a> <br/>
                                   Ce site a été mis en place grâce au <a href="http://www.siteduzero.com"> Site du Zero </a></p>
                      </div>
              </body>
          </html>


                body {
                    padding: 10px;
                    margin : auto;
                    margin-top : 20px;
                            margin-left: 5px;
                    margin-bottom : 20px;
                    background-color : #ffffff;
                }
               #en_tete {
                    text-align : center;
                    background-color : #464646;
                }
                    #en_tete img {
                            border: 1px #464646;
                          }
              #accueil {
                    position : absolute;
                    text-align : center;
                    color : #d20f0f;
                    border : 1px dashed black;
                    margin : 0;
                    padding : 0;
                    padding-left : 2px;
                    padding-right : 2px;
                    margin-top : 3px;
                }
               #livre_d_or {
                    text-align : center;
                    color : #d20f0f;
                    border : 1px dashed black;
           padding : 0;
           padding-left : 2px;
           padding-right : 2px;
           margin : 0;
                    margin-top : 3px;
                    margin-left : 48px;
                    margin-right : 655px;
                }
               table {
                    margin : 0;
                    margin-top : 5px;
                    border-collapse : collapse;
                    background-color : #ffc8c8;
                }
               td {
                    border : 1px dashed black;
                }
              a {
                    color : #d20f0f;
                    text-decoration : none;
                }
              a:hover {
                    color : #d20f0f;
                    text-decoration : underline;
                }
              #menu {
                          width: 120px;
                            float : left;
                    padding : 0;
                    padding-top : 5px;
                }

               .element_menu {
           padding-bottom : 10px;
           border : 1px solid black;
           border-top: none;
           margin-bottom : 20px;
           margin-top : 5px;
                }
               .element_menu h3 {
           font-size : small;
           color : #c84a4a;
           text-align : center;
                }
               .element_menu ul {
                          list-style-type : square;
                          padding : 0px;
                    padding-left : 20px;
                    margin : 0px;
                    margin-bottom : 5px;
                    margin-top : 20px;
                }
               .element_menu a {
                    color : #d20f0f;
                    text-decoration : none;
                }
              .element_menu a:hover {
                     color : #d20f0f;
                     text-decoration : underline;
                }
          .img
          {
                  border: 1px outset black;
                  margin-left: 30px;
          }
              #corps {
                     margin-left : 150px;
                     margin-bottom : 50px;
                     margin-top : 15px;
                     padding : 5px;
                     padding-top : 20px;
                     color : #ff5f5f;
                     background-color : #ffffff;
                     border : 1px solid black;
                     text-align : justify;
                }
              #corps p:first-letter {
                     float : left;
                     font-size : 3em;
                     margin-right : 2px;
                }
               #corps h2 {
                     text-align : center;
                     font-family : Arial, serif;
                }
               #corps h3 {
                    height : 30px;
                    padding-left : 30px;
                    text-align : left;
                }
               #corps a {
                    text-decoration : underline;
                    border : 0;
                    color : #ff5f5f;
                }
              #corps a:hover {
                    color : #ff5f5f;
                    text-decoration : none;
                   background-color : yellow;
                    font-style : italic;
                }

          .em
          {
          font-size:x-small;
          font-style: normal;
          position: relative;
          bottom: 50px;
          right: 340px;
          }
               #pied {
                    font-size: x-small;
                            padding-top : 10px;
                    bottom : 5px;
                    padding : 5px;
                    text-align : center;
                    background-color : #ffffff;
                    border : 1px solid black;
                            margin: 0px;
                            margin-top: 2px;
                            margin-bottom: 2px;
                }
          • Partager sur Facebook
          • Partager sur Twitter
            12 juillet 2006 à 18:14:54

            Bon, j'ai un peu la flemme de chercher dans ton code.

            Mais voici un exemple que j'avais fait et qui fonctionne :

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

            <html>
             <head>
              <title></title>
              <style type="text/css">
              /* <![CDATA[ */
               .news{ position: relative; width: 80%; height: 200px; margin: auto; padding: 25px 20px 30px 20px; background: #00ffff; border: 1px solid #800080 }
               body>.news{ height: auto; min-height: 200px }
               .news h3{ margin: 0; padding: 5px 0; text-align: center; background-color:#cccccc; color:#000080; border: 1px solid #000 }
               .news p{ margin: 10px 0; padding: 10px; font-size:1em; border: 1px solid black; background-color: #fff }
               .news .date{ position: absolute; top: 5px; right: 20px; font-style: italic; font-size: 0.8em }
               .news .auteur{ position: absolute; left: 20px; bottom: 10px; font-style: italic; font-size: 0.9em }
              /* ]]>
            */
              </style>
              </head>
              <body>
             
                <div class="news">
                  <h3>TITRE DE LA NEWS</h3>
                  <p>Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......
                  </p>
                  <p>
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......<br />
                  Texte de la news .......
                  </p>
                  <span class="date">Le vendredi 24 avril 2005</span>
                  <span class="auteur">Proposé par Toto</span>
                </div>
              </body>
            </html>


            Inspire toi en.
            • Partager sur Facebook
            • Partager sur Twitter

            problème de date

            × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
            × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
            • Editeur
            • Markdown