将颜色移动到单独的CSS文件不起作用

时间:2023-01-23 20:29:56

This is driving me nuts. I have all of my colors in one CSS file, and all of the other properties in another. Everything works fine except for this part.

这让我疯了。我将所有颜色都放在一个CSS文件中,将所有其他属性放在另一个CSS文件中。除了这一部分,一切正常。

.jwr_post_format:after {
border-color: rgba(255, 255, 255, 0);
border-right-color: #ffffff;
border-width: 8px;
margin-top: -8px;
}

.jwr_post_format:before {
border-color: rgba(204, 204, 204, 0);
border-right-color: #cccccc;
border-width: 9px;
margin-top: -9px;
}

When it's all together like this, it works fine. But when I take the border-color and border-right-color and put it in another css file, the elements do not show (the colors disappear).

当它像这样一起,它工作正常。但是当我使用border-color和border-right-color并将其放在另一个css文件中时,元素不显示(颜色消失)。

What's going on here?

这里发生了什么?

2 个解决方案

#1


1  

The order in wich css files are executed is important. putting part of the css in another file may affect your general heaviour...

执行css文件的顺序很重要。将部分css放在另一个文件中可能会影响你的一般重量......

#2


0  

Could be that :before and :after do not specify any content. I assume you specify the content tag elsewhere in the CSS, but if you did not that would be a definite problem.

可能是:before和:之后不指定任何内容。我假设您在CSS中的其他位置指定了内容标记,但如果不这样,那将是一个明确的问题。

#1


1  

The order in wich css files are executed is important. putting part of the css in another file may affect your general heaviour...

执行css文件的顺序很重要。将部分css放在另一个文件中可能会影响你的一般重量......

#2


0  

Could be that :before and :after do not specify any content. I assume you specify the content tag elsewhere in the CSS, but if you did not that would be a definite problem.

可能是:before和:之后不指定任何内容。我假设您在CSS中的其他位置指定了内容标记,但如果不这样,那将是一个明确的问题。