css - 为什么我的文本在 Safari 和 Chrome 中对齐,但在 Internet Explorer/Firefox 中不对齐?

标签 css

我的网站是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/

相关文章:

html - 将一个元素设置在另一个元素旁边

css - 在 Metro IE 中禁用导航滑动

html - 在 div 中垂直对齐文本和图像

css - Magento 不加载我的 CSS

css - 在 Firefox 中,带有填充的选择框下拉按钮的右边缘在悬停时消失

javascript - Html5 标签视频在 Chrome 上不起作用

CSS3 calc() 验证 : Value Error : width Parse Error

CSS3 动画到悬停状态和返回

html - 无法设置显示高度 :table in CSS

html - 我可以使用 css Direction-rtl < 和 > 交换吗?