简体   繁体   中英

Woocommerce button not aligned to center

My Site is DELIVERY . i was styling the appaerance of each products.i made the product image and price to the center of the div using

.woocommerce #content div.product div.images img, .woocommerce div.product div.images img, .woocommerce-page #content div.product div.images img, .woocommerce-page div.product div.images img,.woocommerce ul.products li.product a img, .woocommerce-page ul.products li.product a img
{width:50% !important;
margin :0 auto !important;}
.woocommerce ul.products li.product .price, .woocommerce-page ul.products li.product     .price,.woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3
{text-align:center;}

and when i tried making the cart button at center it is not actualy moving.

i tried

.woocommerce ul.products li.product a, .woocommerce-page ul.products li.product a
{margin:0 auto;text-align:center;}

but nothing worked.Plaese help!!!

Add text-align: center to the <li> container of the product.

ul.products li{
    text-align: center
}

Try the following on your cart button, also make sure its parent container has a width set.

display: block;
margin: 0 auto;

You can try this.

products li{
    text-align: center
}

and

margin:0 auto;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM