有没有办法对齐shop page上的“添加到购物车”按钮?当产品名称长度不同时。我尝试添加此CSS代码,但是如果没有悬停,它将无法正常工作。
.woocommerce .products .product .button {
font-size: 13px;
/* padding:8px 26px; */
margin-left: 10px;
position: absolute !important;
display: block;
bottom: 30px;
vertical-align: bottom !important;
}
.woocommerce a.added_to_cart {
/* display: inline-block; */
font-size: 12px;
line-height: 18px;
padding-top: 8px;
position: absolute !important;
display: block;
bottom: 30px;
vertical-align: bottom !important;
white-space: nowrap;
border-bottom: 1px solid transparent;
}
最佳答案
如果产品名称足够长,请尝试破坏产品名称,或使用“产品名称太长.....”以这种方式显示产品名称。或者更好地覆盖子主题上的模板archive.php。