Johnson
Johnson

Reputation: 818

HTML: Text at the same spot

alt text

My image says it all.

At #1 screenshot is how it is right now

At #2 is how I want it to be

How can i do this?

Here's 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>

Upvotes: 3

Views: 158

Answers (1)

jwueller
jwueller

Reputation: 30996

Add a margin 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 unobstrusive CSS and move your styles out of your markup (use external files).

Upvotes: 2

Related Questions