HTML: text in the same place

alt text

My image says it all.

Screenshot 1 shows how this is done right now

In # 2 I want him to be

How can i do this?

Here is my current html:

<div>
<span style='float: left; margin: 10px; width: 60px; display: block;'>
<img style='border: 1px solid #FFF; width: 61px; height: 80px;' src='images/profilePhoto/thumbs/104.jpg'>
<br>Rafo O.
</span>
<h1>(inget ämne)</h1>
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec fringilla urna eget urna euismod aliquet. Duis porta volutpat blandit. Phasellus bibendum bibendum porta. Nunc molestie tristique leo, sed euismod orci ultricies vitae. Mauris non libero a leo ultricies laoreet. Suspendisse luctus urna vel sapien tristique vitae semper nulla eleifend. Integer congue aliquam pharetra. Phasellus diam neque, tincidunt vel elementum vel, ornare sit amet mi. Nulla tincidunt purus in odio vulputate mollis. Nunc urna odio, rutrum eu ultricies a, facilisis ullamcorper nunc. In purus velit, varius vel laoreet eu, tincidunt non purus. Nulla facilisi. Sed ac lectus nibh. Praesent non velit nibh.<br />
........
</div>
<p style='float: right; color: grey; font-weight: bold;'>1-11-2010 kl. 13:28</p></div>
<div class='clearfloat'></div>
+3
source share
1 answer

Add a field to the left of the text:

<div style="margin-left:100px;">
    <h1>(inget ämne)</h1>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. [...]
    </div>
</div>

You should consider unobtrusive CSS and move styles from your markup (use external files).

+2
source

Source: https://habr.com/ru/post/1772758/


All Articles