I have a grid presenting people. Their names with a picture. The name must be displayed on 2 line. First name on the first line and surname on second one.
I can't change the html (I would use <br/>
tag and it would be solved).
I need to find a way (CSS prefered) to achieve this.
HTML:
<div id="wrap">
<article>
<header>
<h2>
<a href="#">Veronique Bertis</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
<article>
<header>
<h2>
<a href="#">Delphine Donlec</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
<article>
<header>
<h2>
<a href="#">Marie-France Aroul</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
<article>
<header>
<h2>
<a href="#">Gwen Domis-Achrall</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
<article>
<header>
<h2>
<a href="#">Marie-Laure Le Fren</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
<article>
<header>
<h2>
<a href="#">Michel Rian</a>
</h2>
</header>
<div>
<img src="http://placekitten.com/200/130" />
</div>
</article>
</div>
CSS
#wrap{
width:670px;
}
article {
width:33.3%;
float:left;
}
h2 a {
text-decoration:none;
font-size: 30px;
font-family:arial,serif;
color:#000;
}
I have tried to use word-spacing
width a high value , that solves part of the problem, but Some surnames have 2 words and I therefore have three lines.
I also have looked for a :first-word
selector but it doesn't exist... see here
Does anyone have a solution for this?