Post: I have no idea what section to post this in
03-04-2016, 04:26 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I need help centering an image. I have no idea how to do it. I just started learning how to code html and css but i don't know how to center this image. Can someone please help?
     <img src="https://biasbear.com/wp-content/uploads/2012/07/mw3logo.jpg"/>
(adsbygoogle = window.adsbygoogle || []).push({});
03-04-2016, 05:20 PM #2
Toxic
former staff
Originally posted by HipHopSizz View Post
I need help centering an image. I have no idea how to do it. I just started learning how to code html and css but i don't know how to center this image. Can someone please help?
     <img src="https://biasbear.com/wp-content/uploads/2012/07/mw3logo.jpg"/>


there are two ways to do it (or more, idk)
1) via html:
use the <center> tag, or i think there are some bootstrap shit that already does this shit
2)via css:
add a class or an id to the element (better, i'll do it via an id),
then add this to your css code
#id {
display: block;
margin-left: auto;
margin-right: auto
}

The following user thanked Toxic for this useful post:

HipHopz
03-05-2016, 02:49 AM #3
Specter
Pro Memer
You posted in the correct section, what Toxic said will definitely work I'd just keep in mind <center> tags are deprecated and most likely won't work if you use strict headers. The CSS approach would be the more "correct" approach, which Toxic also included in his answer. I'm going to go ahead and close this as your question has been answered =D

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo