View Full Version : HTMl / css Image help.
iBlueBox
04-01-2014, 10:48 PM
Pretty new to html / css and all that, but basically.
I have an image on my site, and I want the image in the centre of the page, how do I go about doing this?
lRhyss
04-01-2014, 10:54 PM
<div align="center"><img href="IMAGE LINK"></div>
Calum0812
04-01-2014, 11:16 PM
<div align="center"><img href="IMAGE LINK"></div>
Yes this or you can make a CSS class and have the div be a class. That's a slightly better way of doing it :)
iBlueBox
04-01-2014, 11:16 PM
<div align="center"><img href="IMAGE LINK"></div>
Thanks!
Just wondering,
Say If I want 3 images in a row next to each other, how would I do that?
Calum0812
04-01-2014, 11:18 PM
Thanks!
Just wondering,
Say If I want 3 images in a row next to each other, how would I do that?
<div align="center"><img href="IMAGE #1 LINK"><img href="IMAGE #2 LINK"><img href="IMAGE #3 LINK"></div>
:)
Or as I said above, substitute align for class as appropriate.
Take a look at this :)
http://www.w3schools.com/html/default.asp
Chippiewill
04-01-2014, 11:37 PM
<style>
img.center {
display: block;
margin: 0 auto;
}
</style>
<img class="center" src="http://myawesomeimage.com/image.png" />
Is the preferred way to do it. The div tag's align attribute is not supported in HTML5.
The Don
05-01-2014, 05:09 PM
<style>
img.center {
display: block;
margin: 0 auto;
}
</style>
<img class="center" src="http://myawesomeimage.com/image.png" />
Is the preferred way to do it. The div tag's align attribute is not supported in HTML5.
This is the best way to do it...
Pretty new to html / css and all that, but basically.
I have an image on my site, and I want the image in the centre of the page, how do I go about doing this?
I see someone has helped you, for loads more ideas and help visit w3schools.org
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.