Html 是什么在这些社交媒体按钮中产生了利润?

Html 是什么在这些社交媒体按钮中产生了利润?,html,css,Html,Css,HTML: 输出 如何使图标水平对齐?我在浏览器控制台中看到,伴随着每个动态生成的按钮的javascript包含一些宽度属性,但我不确定如何访问它们 它是您的iframe的宽度:109px <iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" src="..." class="twitter-share-button twitter-tweet-button twitt

HTML:

输出


如何使图标水平对齐?我在浏览器控制台中看到,伴随着每个动态生成的按钮的javascript包含一些宽度属性,但我不确定如何访问它们

它是您的
iframe的
宽度:109px

<iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" src="..." class="twitter-share-button twitter-tweet-button twitter-share-button twitter-count-horizontal" title="Twitter Tweet Button" data-twttr-rendered="true" style="width: 109px; height: 20px;"></iframe>

这是代码生成的iframe元素的宽度,我猜它留出了足够的空间,让计数器达到1000,而不会被切断!它正在生成一个内联宽度。你可以这样做,但这是个坏主意

#twitter-widget-0 {width:81px !important;}

啊,太好了,谢谢你的指点。如果JS正在生成内联宽度,那么可能会让它增加喜欢的数量的宽度……也许但我的猜测是代码本身并不麻烦,所以它只留下了1000的空间,你可以像上面那样使用css,然后继续关注它,或者如果你知道如果你设置了宽度为90像素,可工作到999像素
<iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" src="..." class="twitter-share-button twitter-tweet-button twitter-share-button twitter-count-horizontal" title="Twitter Tweet Button" data-twttr-rendered="true" style="width: 109px; height: 20px;"></iframe>
iframe{
   width: 85px !important; //the important is needed to override the inline width
}
#twitter-widget-0 {width:81px !important;}