简体   繁体   English

CSS 错误在规则或选择器预期css(css-ruleorselectorexpected)

[英]CSS ERRORS at-rule or selector expectedcss(css-ruleorselectorexpected)

I received 3 errors in the following code;我在以下代码中收到 3 个错误;

 <style media="screen">.sqs-audio-embed{ visibility: hidden; }

Error 1: at-rule or selector expectedcss(css-ruleorselectorexpected)

Error 2: { expectedcss(css-lcurlyexpected)

Error 3: at-rule or selector expectedcss(css-ruleorselectorexpected)

This is the entire.css file这是整个.ZC7A62​​8CBA22E28EB17B5F5C6AE2A266AZ文件

div { font-family: Arial, Helvetica, sans-serif; font-size: 80px; color: #fff; position: absolute; left: 150px; top: 200px; }.post-content{ opacity: 0.5; top: 0px; left: 0px; position: absolute; }.thumbnail{ position: relative; } <style media="screen">.sqs-audio-embed{ visibility: hidden; }.root{ --main-bg-color: brown; }

I tried to search for a solution but I had no luck.我试图寻找解决方案,但没有运气。 Can someone explain these errors and explain how to correct them?有人可以解释这些错误并解释如何纠正它们吗?

Thanks In Advance提前致谢

You said it's in ".css" file.你说它在“.css”文件中。 <style> is an html element, so you should not use it inside css file. <style>是一个 html 元素,所以你不应该在 ZC7A62​​8CBA22E28EB17B5F5C6AE2A266AZ 文件中使用它。 I think you should use media queries instead, something like this:我认为您应该改用媒体查询,如下所示:

 @media screen {.sqs-audio-embed { visibility: hidden; } }

please refer MDN Docs for more information.请参阅MDN 文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM