Position an image in an html page

Solved
Cbast7 Posted messages 118 Status Membre -  
 Kratos -
Hello,

I would like to place an image on an HTML page, meaning I want to position it where I want, in my case next to some text and not at the bottom of the page. How can I do this, please?
Configuration: Windows XP Firefox 3.0.11

2 réponses

monkey_monk Posted messages 611 Registration date   Status Membre Last intervention   132
 
Here is an example of what you are asking for:

[HTML]
<img class="left" src="image.jpg" width="225" height="150" alt="" title="" /> <h2>A subtitle.</h2> <p>A paragraph.</p>


[CSS]

.left { float:left; margin:0 10px 0 20px; } // margin = top,right,bottom,left


Note, to make it simpler you can do:

<img class="left" src="image.jpg" width="225" height="150" alt="" title="" style="float:left;margin:0 10px 0 20px;" />


Have a nice day.

70
monkey_monk Posted messages 611 Registration date   Status Membre Last intervention   132
 


<img class="left" src="image.jpg" width="225" height="150" alt="" title="" style="float:left;margin:0 10px 0 20px;" />



--
[Monkey Monk]
17
Cbast7 Posted messages 118 Status Membre 21
 
Yes, I prefer working with CSS; it will teach me more, but if I see that I'm struggling a bit, of course, I'll go with that code =)
3