Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML: Text at the same spot

Tags:

html

css

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>
like image 781
Johnson Avatar asked May 02 '26 09:05

Johnson


1 Answers

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).

like image 61
jwueller Avatar answered May 03 '26 23:05

jwueller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!