Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When using the default code from http://www.addthis.com/ with Twitter's Bootstrap 3 the right border of the counter is missing:

Addthis buttons and counter with Twitter's Bootstrap 3

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
815 views
Welcome To Ask or Share your Answers For Others

1 Answer

Twitter's Bootstrap 3 use a CSS's universal selector to set box-sizing (see: https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing) to border-box. This will be save cause support for IE7 has been dropped. This selector breaks the AddThis counter.

The counter is set by: <a class="addthis_counter addthis_bubble_style"></a>.

Solution: Reset the box-sizing for the .addthis_counter class. Add the following code after your bootstrap css:

 .addthis_counter
{
  -webkit-box-sizing: content-box;
     -moz-box-sizing: content-box;
      box-sizing: content-box;
}

Or Less:

.addthis_counter,
.addthis_counter * { .box-sizing(content-box); }

See also: http://getbootstrap.com/getting-started/#third-parties and Why did Bootstrap 3 switch to box-sizing: border-box?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...