span,div ,p element. What should I use and how?
Posted
by Cesar Lopez
on Stack Overflow
See other posts from Stack Overflow
or by Cesar Lopez
Published on 2010-03-16T15:52:40Z
Indexed on
2010/03/16
16:01 UTC
Read the original article
Hit count: 194
I have the following problem.
I have a td which I need to add other three elements inside (span,div,p, or any other suggestion) in order to align the three elements inside one next to each other (the content of this elements is text).
If all the elements contains a single line of text, then everything its fine.
The problem comes when the first to are single line of text and third element contains more than one line of text, then text of third element it would go under first element, but I need it to go under third element.
eg.
Output desired.
Title on element1: (subtitle on element 2) Text on element 3
with several lines
of text.
Actual output.
Title on element1: (subtitle on element 2) Text on element 3
with several lines of text.
html code sample
<td>
<span display="inline">Title on element1:</span>
<span display="inline">(subtitle on element 2)</span>
<span display="inline">Text on element 3 <br/>
with several lines <br/> of text.</span>
</td>
© Stack Overflow or respective owner