(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?
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?
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:
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