CSS 中的背景颜色与 Google Adsense 冲突
我正在使用背景颜色来分隔/突出显示我在书评网站中的评论。书本文字正常,没有(白色)背景。我的评论使用以下 css:
#my-post-response{
margin: 5px 5px 10px 20px;
background-color:#FFFFCC;
border: 3px solid #888;
font-style: italic;
font-weight: bold;
padding: 10px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
position: relative;
behavior: url(/border-radius.htc);
}
问题是评论位于随机区域,并且当 google adsense 相邻时,文本不会重叠,但背景颜色会重叠。请查看此屏幕截图:http://screencast.com/t/qRexO78j2
I am using a background color to separate/highlight my comments within a book for a review site. The book text is normal with no (white) background. My comments use the following css:
#my-post-response{
margin: 5px 5px 10px 20px;
background-color:#FFFFCC;
border: 3px solid #888;
font-style: italic;
font-weight: bold;
padding: 10px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
position: relative;
behavior: url(/border-radius.htc);
}
The problem is that the comments are in random areas and when google adsense is adjacent, the text doesn't overlap but the background-color does. Please view this screenshot: http://screencast.com/t/qRexO78j2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果无法看到实际的代码,这是很困难的。但它看起来像一个清除问题尝试添加
clear:both;
或clear: left;
/clear:right;
到元素,这应该让你朝着正确的方向前进。至于背景颜色问题,请尝试重新排序已清除的元素,使向右浮动的元素首先出现在代码中,并为这两个元素设置 z-index,即
z-index:100;
和z -索引:200;
It's difficult without being able to see the actual code. But it looks like a clearing issue try adding
clear:both;
orclear: left;
/clear:right;
to the elements, that should get you going in the right direction.As to the Background colour issue, try reordering the cleared elements so the element floating right appears first in the code and setting a z-index for both elements i.e.
z-index:100;
andz-index: 200;