Image will not center when setting width

I am very new to HTML, CSS . I am currently using bootstrap and trying to put an image inside a line. I tried to center the image using the class center-blockalong with the class img-responsive, but it just does not center.

I tried to use the method text-align: center;, but the result is still the same. I noticed that when I set the width of the image, the centering does not work no matter what I do. Spent the whole night, realizing this, to no avail. I would like to get some ideas.

my website is http://achmadhendra.byethost13.com/

+4
source share
2 answers

The image will not be centered because you wrapped it in div, spanning only 8 columns - col-xs-8.

If you change this divto use col-xs-12and then specify the imgset width, it will work.

+1
source

You can simply use the col-md-12 class and specify the image width manually.

0
source

Source: https://habr.com/ru/post/1676582/


All Articles