My HTML/CSS task seems white simple: I need a number (variable length) before a multi-line paragraph and the text shall have an indention, so the second line starts at the same position as the first line:
1. This is text in
two lines
10. This is another
text in two lines
If I knew the necessary indention, this would be an easy task using CSS:
<p style="padding-left: 14px; text-indent: -14px">1. This is text in two lines</p>
Yet, I do now know and my goal is to have a dynamic indention (without using JavaScript). The reason: The paragraphs are on different webpages and having lots of space on page 1 is not very beautiful.
One possible solution would be a table construction (via <table>
or CSS-tabled DIVs), but one table construction for each paragraph probably is oversized.
Another possible solution would be a floating DIV for the number ... but I do not know the height of the text.
<div style="float: left; width: 1px; height: ?; overflow: visible">1.</div>
This is text in two lines
Therefore, I am looking for a more elegant solution to solve this, using HTML and CSS. Thank you for your ideas!
BurninLeo
- Text1
- Text2
– Ricardo Castañeda Jan 05 '15 at 23:21` for each such paragraph. That would be quite a misuse of `
– BurninLeo Jan 05 '15 at 23:25`.