除非重复规则集,否则 CSS 将无法工作

标签 css

我有两个类,left 和 right,它们 float 和清除左右的东西(真正疯狂的东西)。

但是问题来了。

.dashWrap h3 {
background-color: #666;
border: 2px solid #000;
/*border-radius: 0.5em 0.5em 0 0;*/
text-indent: 0.5em;
}

.dashWrap .dashContent {
/* max-height: 5em;*/
min-height:5em;
overflow-x: hidden;
overflow-y: auto;
border: 2px solid #000;
border-top-color: transparent;
}​

.right  //If I delete or comment this out, left no longer is applied to anything.
{
clear:right;
float:right;
width:35%;
}
.left
 {
float:left;
clear:left;
 }
.right  //If I delete or comment out this, right no longer is applied to anything.
 {
clear:right;
float:right;
width:35%;
 }

这正是我正在编辑的文件中的部分。当我加载网站时,实际源文件的唯一区别是在 .dashContent 结束 curl 之后,有这样的:

​

这可能是什么原因造成的?

最佳答案

您的文件中有一些不可见或损坏的字符,因此 .dashContent 之后的第一条规则将被破坏并被浏览器忽略。

尝试删除规则之间的所有内容以去除不可见字符,如果失败,您可以尝试将规则复制到新文件中。如果一切都失败了,您可能需要重新键入文件的一部分。

关于除非重复规则集,否则 CSS 将无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11083359/

相关文章:

html - 如何在框中写入文本,使其仅覆盖框的 50%?

html - 如何包含漂亮的 Facebook、Twitter、G+ 分享按钮?

html - 缩放时保持内容居中

html - 证明内容 : center does not work in IE11

html - 只有当页面足够小时才让页脚贴在底部

javascript - 动态加载的 div 的事件名称

javascript - Html 表格拆分列一分为二?

html - CSS3 变换属性不适用于响应式导航栏

html - 从单个页面中删除导航

css - Bootstrap 4 CSS 未应用