How to center a static picture

1
Which style to use to horizontal align a static picture (align: center or text-align: center do not work) in a form.
asked
2 answers
3

Depends on the layout of the image and the surrounding container. Either set text-align: center on the surrounding container, or margin-left : auto, margin-right: auto on the element you want to center itself.

In any case, the surrounding element should have a width (100% probably) otherwise there might be nothing to center to

answered
3

Just came across this problem and found entering the class ‘center-block’ works perfectly!

Read the docs here: https://getbootstrap.com/docs/3.3/css/#images (Use CTRL + F to find ‘center-block’ quickly)

answered