Archived topic
centre a div in a section
4 replies · Started by haborg on September 28, 2016
Hi,
Trying to centre a div with four horizontal icons in a section on a page. The attribute "margin: auto" doesn't work in the section. This is what I have tried:
.icons {
width: auto;
hight: auto;
display: block;
margin: auto;
}
And this is the site: http://nackagarden.capito.se/
Any suggestions?
/Hakan
Hi haborg,
My suggestion (sorry Tom :) ) is to use the free, lite version of the Beaver Builder plugin available on the WP Plugin repository here:
https://wordpress.org/plugins/beaver-builder-lite-version/
Then you will not need to use a GP Section, just launch BB on that page, drag out a 4 column row and add a Photo module to each one and set the required icons as the images ... takes less than a minute :)
Cheers!
Lyle
That's definitely one way :)
If you want to use your #icons div, you can do this:
#icons {
max-width: 800px;
margin: 0 auto;
text-align: center;
}
margin: 0 auto only works if the element has a width.
Great!
Thanks to both. Simple, smart and flexible solutions!
Best,
Hakan
Glad I could help :)