IMAGES | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

IMAGES

I am having a hard time centering my images in HTML. Does anyone know how to do that?

29th Jun 2018, 3:29 PM
Jazzy
Jazzy - avatar
1 Answer
+ 1
do this, applies for all no matter what. suppose you have a div element or image or something with id = "container" and width(that you'll define) as x; so the CSS will be #container { position:relative; left:calc(50% - (x/2)px); } don't use the x/2 as I used just add the numerical value.
29th Jun 2018, 3:49 PM
RZK 022
RZK 022 - avatar