gpt4 book ai didi

html - 错误 : Invalid CSS after "body ": expected selector or at-rule, 是第 4 行的 "{"

转载 作者:太空宇宙 更新时间:2023-11-04 01:13:09 25 4
gpt4 key购买 nike

我在 style.scss 中编写代码如下代码:body {margin-top:105px;} 我从我的 sass 编译器(Koala)和 style.scss 中得到了这个错误消息

Error: Invalid CSS after "body ": expected selector or at-rule, was "{" on line 4 of C:\Users\Petar\Desktop\Mizuxe novo\scss\style.scss

我是这方面的初学者,所以如果您需要更多信息,请询问

https://codepen.io/petar-scepanovic/pen/Papmxj

/*
Error: Invalid CSS after "body ": expected selector or at-rule, was "{"
on line 4 of C:\Users\Petar\Desktop\Mizuxe novo\scss\style.scss

1: $primary: #3292a6;
2: $primary-overlay:rgba(50,146,166, 0.8)
3:
4: body {
5: margin-top:105px;
6: }
7:
8:
9: .navbar {

Backtrace:
C:\Users\Petar\Desktop\Mizuxe novo\scss\style.scss:4
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/scss/parser.rb:1278:in `expected'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/scss/parser.rb:1208:in `expected'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/scss/parser.rb:42:in `parse'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/engine.rb:414:in `_to_tree'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/engine.rb:290:in `render'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/exec/sass_scss.rb:400:in `run'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/exec/sass_scss.rb:63:in `process_result'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/exec/base.rb:52:in `parse'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/lib/sass/exec/base.rb:19:in `parse!'
C:/Program Files (x86)/Koala/rubygems/gems/sass-3.5.2/bin/sass:13:in `<top (required)>'
C:/Program Files (x86)/Koala/bin/sass:22:in `load'
C:/Program Files (x86)/Koala/bin/sass:22:in `<main>'
*/
body:before {
white-space: pre;
font-family: monospace;
content: "Error: Invalid CSS after \"body \": expected selector or at-rule, was \"{\"\A on line 4 of C:\Users\Petar\Desktop\Mizuxe novo\scss\style.scss\A \A 1: $primary: #3292a6;\A 2: $primary-overlay:rgba(50,146,166, 0.8)\A 3: \A 4: body {\A 5: margin-top:105px;\A 6: }\A 7: \A 8: \A 9: .navbar {"; }

最佳答案

您刚刚在 CSS 的第 2 行漏掉了一个分号。

改变:

$primary-overlay:rgba(50,146,166, 0.8)

到:

$primary-overlay:rgba(50,146,166, 0.8);

完成了!

关于html - 错误 : Invalid CSS after "body ": expected selector or at-rule, 是第 4 行的 "{",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50796220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com