Alignement vertical

Résolu/Fermé
hatouma - Modifié le 3 oct. 2007 à 14:16
 hatouma - 3 oct. 2007 à 14:16
Bonjour,svp je veux une aide : comment je peut mettre 2 logo au meme niveau (alignement verticale) j'ai essayé avec l'attribut .vspace la balise applet mais rien n'a changer.je travail avec le language HTML.j'attend réponse merci pour votre aide

2 réponses

Gihef Messages postés 5150 Date d'inscription mercredi 20 juillet 2005 Statut Contributeur Dernière intervention 20 février 2023 2 775
1 oct. 2007 à 15:26
Bonjour,

Si tu ne veux pas te casser la tête, opte pour un tableau.
Mais emploie “valign” à bon escient.
Comme dans cet exemple :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Alignement vertical par un tableau</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <style type="text/css">
    html, body {
      margin: 0;
      padding: 0;
      text-align: center;
      background-color: #b0c4de;
      }
    #conteneur {
      position: relative;
      margin: 0 auto;
      width: 760px;
      border : 2px solid #fff;
      background-color: #f0ffff;
      font-family: Tahoma, 'Trebuchet MS', Verdana, Optima, Papyrus, sans-serif;
      }
  table {
    width : 100%;
    }
  td {
    text-align: center;
    color : #b0c4de;
    height : 200px;
    border : 1px dashed #858;
    }
  p {
    margin : 2em 0 0 0;
    }
    </style>
</head>
<body>
  <div id="conteneur">
  <table>
    <tr>
      <td colspan="2" style="height:auto; border:0;">
        <p>&amp;lt;td valign="middle"></p>
      </td>
    </tr>
    <tr>
      <td valign="middle">
        <img src="Image1.png" alt="Image1" width="193" height="127" />
      </td>
      <td valign="middle">
        <img src="Image2.png" alt="Image2" width="192" height="271" />
      </td>
    </tr>
    <tr>
      <td colspan="2" style="height:auto; border:0;">
        <p>&amp;lt;td valign="top"></p>
      </td>
    </tr>
    <tr>
      <td valign="top">
        <img src="Image1.png" alt="Image1" width="193" height="127" />
      </td>
      <td valign="top">
        <img src="Image2.png" alt="Image2" width="192" height="271" />
      </td>
    </tr>
    <tr>
      <td colspan="2" style="height:auto; border:0;">
        <p>&amp;lt;td valign="bottom"></p>
      </td>
    </tr>
    <tr>
      <td valign="bottom">
        <img src="Image1.png" alt="Image1" width="193" height="127" />
      </td>
      <td valign="bottom">
        <img src="Image2.png" alt="Image2" width="192" height="271" />
      </td>
    </tr>
  </table>
  </div>
</body>
</html>
À toi de créer 2 images pour le tester.

--
4
Bonjour,
mon probleme est résolu merci bien Gihe.f
0
Bonjour,

il existe plusieurs méthodes ayant des avantages et des inconvénient pour l'alignement vertical.

ça ne se fait pas de la même manière avec un positionnement basé sur les tableaux (méthode des années 90, non recommandable, lourde) qu'avec un positionnement utilisant les feuilles de style (CSS)

pour plus d'informations sur les CSS
cssintro
https://www.alsacreations.com/
https://openweb.eu.org/css/
http://css.mammouthland.net/
https://www.w3schools.com/css/
3