簡體   English   中英

中心AddThis內聯跟隨按鈕div

[英]Center AddThis Inline Follow Buttons div

我試圖居中AddThis內聯跟隨按鈕。 默認情況下,它們左對齊。

跟隨按鈕的代碼是:

<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_follow_toolbox"></div>

我試圖像這樣在div中添加它們:

<div class="center_aift">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_follow_toolbox"></div>
</div>

我添加了以下CSS,但沒有任何區別,它們仍然對齊左側。

.center_aift {
    width: 100%;
    text-align: center;
}

我正在使用帶有自定義代碼塊的SquareSpace,但不認為這是問題所在。

上面我問過關於檢查DOM樹中是否引起左對齊的樣式,例如按鈕上的浮點數。 在您的示例中 ,按鈕上有一個浮點數。 確切的CSS是:

.addthis_default_style .addthis_separator,
.addthis_default_style .at4-icon, 
.addthis_default_style .at300b,
.addthis_default_style .at300bo, 
.addthis_default_style .at300bs,
.addthis_default_style .at300m {
    float: left;
}

float: none;覆蓋該樣式float: none; 然后添加text-align: center; 到具有class addthis_toolbox addthis_default_style類的父div容器。 按鈕將居中。

萬一AddThis決定添加更多以類似方式(帶有“ at”)開始的類,我將其更改為:

.addthis_default_style .addthis_separator,
.addthis_default_style [class^="at"] {
    float: none;
    text-align: center;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM