我的网站是wordswithfriends.net
在侧边栏中的 Safari/Chrome 中,例如“每月倒计时”的标题和正文排列完全一致。在 IE/Firefox 中,标题更靠右,文本一直推到左边。我的代码有什么问题?
编辑CSS:
#sidebar h3 {
background: url (images/sidebarh3bgr.png) no repeat;
color: white;
font-size: 14px;
margin: 0 0 10px;
padding: 5px 5px 5px 18px;
}
#sidebar li .top {
padding: 0px 0px 15px 1px;
width: 333px;
background: no-repeat url(images/bcksidebarlitop.png);
}
.execphpwidget {
margin: 10px 23px 0px 10px;
padding: 5px 5px 5px 10px;
}
.textwidget {
padding: 5px 5px 5px 17px;
}
#sidebar ul {
list-style-type: none;
margin: 0;
padding: 3px 17px;
}
最佳答案
Firefox 中的 Firebug 和 IE 中的开发人员工具都显示为您的类*.execphpwidget
定义的样式未被应用。两种检查方法都表明样式正在被覆盖;它只是不存在。
对您的样式表的快速验证表明您在第 470 行附近有一些错误的 CSS:
img .alignnone size-full wp-image-364 {float:right;填充:5px 10px 10px 0px;"
看这里: W3C CSS Validation Service
由于此错误,IE 和 Firefox 将丢弃样式表的其余部分,其中包括您丢失的左侧填充/边距。
我猜 Chrome 和 Safari 更宽容。
关于css - 为什么我的文本在 Safari 和 Chrome 中对齐,但在 Internet Explorer/Firefox 中不对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4930376/