Skip to content
← Back to Community
HTML : How to put images next to text that floats
Profile icon
Akkker

So I have this website I want to do in HTML. I have a bunch of text that is classified as "droite" and "gauche" (witch I want to be respectively equal to "float-right" and "float-left")
And I would like to put images near the text (like, when the text is at the right, I would like to have an image at the left)

But I have problems with the window. Like, when it is in a smaller window its easy everything seems rights but when the window is larger.... Well everything goes poorly. The images are bigger than the text, goes everywhere and what else. Plus, the text doesn't want to go at the right...

I really do not understand what is wrong. I try to change things with margins but it didn't change much. I try to make it float or cesse to float but nothing changed... I might have done it wrong tho...
Help !

Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Voters
Profile icon
Akkker
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

Solution

the website doesn't work for me but, if you want images to float, and stuff, try this.

<style> .image { float: left; } </style> <img src="YOURIMAGEURL" class="image">

or you could do margin

<style> .image { margin-right: 100px; /* goes left if you use right. goes right if you use left } </style>

like that.
Any of them should work

Profile icon
Akkker

Thanks ! The problem is that I want two floating blocs to be together or next to one and an other. This doesn't work because then my other floating bloc goes underneath. @RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@Akkker then use margin for that. margin left, top, bottom.

Profile icon
Akkker

It does not work, I tried.
@RYANTADIPARTHI

Profile icon
Akkker

The images are enormous and go everywhere

Profile icon
RYANTADIPARTHI