Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force span to occupy 2 lines

Tags:

html

css

I have multiple divs that have some image and span contents inside. The height of the div is determined by the contents but the problem I am having is the divs tend to differ in height due to the text. Some span's value occupies 2 lines because the text is long while some only single line.

What I need is to force all short-texted spans to occupy 2 lines, or maybe is there a better layout alternative for this to make sure all divs are of equal height regardless of length of the span?

Thanks.

like image 441
g_b Avatar asked Nov 03 '14 03:11

g_b


1 Answers

add display: block; to all spans and define a height.

like image 122
stevemao Avatar answered Oct 17 '22 11:10

stevemao