1

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

问题是我无法将父帖子内容部分(其中显示“甲状腺颈部肿块的原因”)定位为“clear:both”

我尝试了以下代码:

.-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 太大了,但这是我感兴趣的部分。

脸书喜欢

4

1 回答 1

0

如果您想定位所有人div而不管他们的名字如何,只需使用它div{ clear: both },并且如果您想定位一个特定的 div 其名称可能会更改,您可以使用它xpath来解决该特定的div

于 2012-09-03T11:43:01.260 回答