Facebook喜欢CSS样式(Facebook like CSS styling)

编程入门 行业动态 更新时间:2024-10-28 10:31:49
Facebook喜欢CSS样式(Facebook like CSS styling)

我正在使用CSS样式来修复默认Facebook风扇框的样式。

问题是,我不能将“明确:两者”定位到父帖子内容部分(其中称为“甲状腺颈部肿块的原因”)

我尝试下面的代码:

.-cx-PRIVATE-uiImageBlock__content{ clear: both; }

但它似乎只能在我的计算机上运行,​​因为类名会根据你所使用的计算机而改变?

是否有一种方法可以针对该div而不管它是否与所有计算机/浏览器/操作系统的“清除:两者”相同?

以下是HTML内容:

<div class="clearfix"><a class="external -cx-PRIVATE-uiImageBlock__image -cx-PRIVATE-uiImageBlock__largeImage lfloat" aria-hidden="true" href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/?ref=nf" rel="nofollow" target="_blank" data-ft="{&quot;type&quot;:41,&quot;tn&quot;:&quot;E&quot;}" tabindex="-1" onmouseover="LinkshimAsyncLink.swap(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf&quot;);" onclick="LinkshimAsyncLink.referrer_log(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf&quot;, &quot;http:\/\/www.facebook.com\/si\/ajax\/l\/render_linkshim_log\/?u=http\u00253A\u00252F\u00252Fwww.thyroid.com.au\u00252Fblog\u00252Freasons-for-thyroid-neck-lumps\u00252F\u00253Fref\u00253Dnf&amp;h=wAQEaywabAQFjkWBq_12A_eL7rVFG7Tv4gu0VXfElQqzWdA&amp;s=1&quot;);"><img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=254577506873&amp;v=1&amp;size=z&amp;cksum=6832c1a10fa088b2eb112fe71667be00&amp;src=http%3A%2F%2Fwww.thyroid.com.au%2Fwp-content%2Fuploads%2F2011%2F10%2Fhyperthyroidism.jpg" alt=""></a><div class="-cx-PRIVATE-uiImageBlock__content "><div class="fsm fwn fcg"><div class="uiAttachmentTitle" data-ft="{&quot;type&quot;:11,&quot;tn&quot;:&quot;C&quot;}"><strong><a href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/" target="_blank" onclick="LinkshimAsyncLink.referrer_log(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/&quot;, &quot;http:\/\/www.facebook.com\/si\/ajax\/l\/render_linkshim_log\/?u=http\u00253A\u00252F\u00252Fwww.thyroid.com.au\u00252Fblog\u00252Freasons-for-thyroid-neck-lumps\u00252F&amp;h=aAQHSUMCfAQEtYTi5yinio3ZiIIl7p6PPjwOzidpvNqkbYA&amp;s=1&quot;);" rel="nofollow" onmouseover="LinkshimAsyncLink.swap(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/&quot;);">Reasons for Thyroid Neck Lumps</a></strong> </div><span class="caption" data-ft="{&quot;tn&quot;:&quot;L&quot;}">Thyroid and Parathyroid Gland Surgery Sydney</span><div class="mts uiAttachmentDesc translationEligibleUserAttachmentMessage" data-ft="{&quot;tn&quot;:&quot;M&quot;}"> Reasons for Thyroid Neck Lumps Many people feel a lump in their neck and they immediately become afraid of the C word that no one ever wants to think about. However, this is not always the cause of a lump in the throat and it will be important to get an ...</div></div></div></div>

发布所有HTML都太大了,但这是我感兴趣的部分。

I'm using CSS styling to fix the style of the default Facebook fan box.

The problem is that I cannot target the parent post content section (where it says "Reasons for Thyroid Neck Lumps") for "clear:both"

I tried below code:

.-cx-PRIVATE-uiImageBlock__content{ clear: both; }

But it only seems to work on my computer as class name changes depending on what computer you are on?

Is there a way to target that div regardless so that it is same "clear: both" for all of the computers/browsers/OS?

Below is the content HTML:

<div class="clearfix"><a class="external -cx-PRIVATE-uiImageBlock__image -cx-PRIVATE-uiImageBlock__largeImage lfloat" aria-hidden="true" href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/?ref=nf" rel="nofollow" target="_blank" data-ft="{&quot;type&quot;:41,&quot;tn&quot;:&quot;E&quot;}" tabindex="-1" onmouseover="LinkshimAsyncLink.swap(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf&quot;);" onclick="LinkshimAsyncLink.referrer_log(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf&quot;, &quot;http:\/\/www.facebook.com\/si\/ajax\/l\/render_linkshim_log\/?u=http\u00253A\u00252F\u00252Fwww.thyroid.com.au\u00252Fblog\u00252Freasons-for-thyroid-neck-lumps\u00252F\u00253Fref\u00253Dnf&amp;h=wAQEaywabAQFjkWBq_12A_eL7rVFG7Tv4gu0VXfElQqzWdA&amp;s=1&quot;);"><img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=254577506873&amp;v=1&amp;size=z&amp;cksum=6832c1a10fa088b2eb112fe71667be00&amp;src=http%3A%2F%2Fwww.thyroid.com.au%2Fwp-content%2Fuploads%2F2011%2F10%2Fhyperthyroidism.jpg" alt=""></a><div class="-cx-PRIVATE-uiImageBlock__content "><div class="fsm fwn fcg"><div class="uiAttachmentTitle" data-ft="{&quot;type&quot;:11,&quot;tn&quot;:&quot;C&quot;}"><strong><a href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/" target="_blank" onclick="LinkshimAsyncLink.referrer_log(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/&quot;, &quot;http:\/\/www.facebook.com\/si\/ajax\/l\/render_linkshim_log\/?u=http\u00253A\u00252F\u00252Fwww.thyroid.com.au\u00252Fblog\u00252Freasons-for-thyroid-neck-lumps\u00252F&amp;h=aAQHSUMCfAQEtYTi5yinio3ZiIIl7p6PPjwOzidpvNqkbYA&amp;s=1&quot;);" rel="nofollow" onmouseover="LinkshimAsyncLink.swap(this, &quot;http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/&quot;);">Reasons for Thyroid Neck Lumps</a></strong> </div><span class="caption" data-ft="{&quot;tn&quot;:&quot;L&quot;}">Thyroid and Parathyroid Gland Surgery Sydney</span><div class="mts uiAttachmentDesc translationEligibleUserAttachmentMessage" data-ft="{&quot;tn&quot;:&quot;M&quot;}"> Reasons for Thyroid Neck Lumps Many people feel a lump in their neck and they immediately become afraid of the C word that no one ever wants to think about. However, this is not always the cause of a lump in the throat and it will be important to get an ...</div></div></div></div>

It's too big to post all of HTML but this is the part where I am interested.

最满意答案

如果你想要定位所有div而不管它们的名字只是使用div{ clear: both }并且如果你想要定位一个特定的div,它的名字可能被改变,你可以使用xpath来解决那个特定的div

if you want to target all div regardless of their name just use it div{ clear: both } and if you want to target an specific div that its name may be changed, you can use xpath to address that specific div

更多推荐

本文发布于:2023-08-05 15:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1434033.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:样式   喜欢   Facebook   styling   CSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!