28220 sujets

CSS et mise en forme, CSS3

Bonjour,

J'ai repris un exemple de gallerie photo à partir de définition de liste de cet article de Pompage (chapitre "Styler une liste de définitions pour en faire une galerie d'images" au 3/4 de la page).

Seulement, si un commentaire est plus long que les autres, ça met le binz dans la mise en page. Exemple (les photos peuvent être récupérées depuis l'article) :
<!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="en" >
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title> test</title>
<style type="text/css">

dl.gallery
{
border: 1px solid #000;
background-color: #ddd;
width: 102px;
text-align: center;
padding: 10px;
float: left;
margin-right: 1em;
}

.gallery dt { font-weight: bold; }

.gallery dt img
{
border: 1px solid #000;
width: 100px;
height: 100px;
}

.gallery dd
{
margin: 0;
padding: 0;
}
</style>
</head>

<body>
<div style="width: 430px; border: 1px solid red; display:block;">
<dl class="gallery">
	<dt><img src="flower.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la descriptionIci la descriptionIci la description</dd>
</dl>

<dl class="gallery">
	<dt><img src="flower2.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la description</dd>
</dl>

<dl class="gallery">
	<dt><img src="flower3.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la description</dd>
</dl>
<dl class="gallery">
	<dt><img src="flower.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la description</dd>
</dl>

<dl class="gallery">
	<dt><img src="flower2.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la description</dd>
</dl>

<dl class="gallery">
	<dt><img src="flower3.jpg" alt=""></dt>
	<dt>Ici le titre</dt>
	<dd>Ici la description</dd>
</dl>
<div style="clear: both;"></div>
</div>
</body>
</html>

Y a-t-il un moyen d'aligner la hauteur des cadres pour éviter cet effet ?
Autrement qu'en fixant arbitrairement height puisque la taille du commentaire peut être variable.
Merci

Smiley cligne