我正在使用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="{"type":41,"tn":"E"}" tabindex="-1" onmouseover="LinkshimAsyncLink.swap(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf");" onclick="LinkshimAsyncLink.referrer_log(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf", "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&h=wAQEaywabAQFjkWBq_12A_eL7rVFG7Tv4gu0VXfElQqzWdA&s=1");"><img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=254577506873&v=1&size=z&cksum=6832c1a10fa088b2eb112fe71667be00&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="{"type":11,"tn":"C"}"><strong><a href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/" target="_blank" onclick="LinkshimAsyncLink.referrer_log(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/", "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&h=aAQHSUMCfAQEtYTi5yinio3ZiIIl7p6PPjwOzidpvNqkbYA&s=1");" rel="nofollow" onmouseover="LinkshimAsyncLink.swap(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/");">Reasons for Thyroid Neck Lumps</a></strong> </div><span class="caption" data-ft="{"tn":"L"}">Thyroid and Parathyroid Gland Surgery Sydney</span><div class="mts uiAttachmentDesc translationEligibleUserAttachmentMessage" data-ft="{"tn":"M"}"> 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="{"type":41,"tn":"E"}" tabindex="-1" onmouseover="LinkshimAsyncLink.swap(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf");" onclick="LinkshimAsyncLink.referrer_log(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/?ref=nf", "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&h=wAQEaywabAQFjkWBq_12A_eL7rVFG7Tv4gu0VXfElQqzWdA&s=1");"><img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=254577506873&v=1&size=z&cksum=6832c1a10fa088b2eb112fe71667be00&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="{"type":11,"tn":"C"}"><strong><a href="http://www.thyroid.com.au/blog/reasons-for-thyroid-neck-lumps/" target="_blank" onclick="LinkshimAsyncLink.referrer_log(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/", "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&h=aAQHSUMCfAQEtYTi5yinio3ZiIIl7p6PPjwOzidpvNqkbYA&s=1");" rel="nofollow" onmouseover="LinkshimAsyncLink.swap(this, "http:\/\/www.thyroid.com.au\/blog\/reasons-for-thyroid-neck-lumps\/");">Reasons for Thyroid Neck Lumps</a></strong> </div><span class="caption" data-ft="{"tn":"L"}">Thyroid and Parathyroid Gland Surgery Sydney</span><div class="mts uiAttachmentDesc translationEligibleUserAttachmentMessage" data-ft="{"tn":"M"}"> 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
更多推荐
发布评论