简体   繁体   English

CSS 错误编译

[英]CSS Errors Compiling

I am having a bit of an issue programming my website for OceanGrownFin.com.我在为 OceanGrownFin.com 编写我的网站时遇到了一些问题。 If you scroll thru the site, the three sections I'm having trouble with are the CSS backgrounds for the events, my video pop out, and my twitter feed.如果您滚动浏览网站,我遇到的三个部分是事件的 CSS 背景、我的视频弹出和我的 twitter 提要。 On each of these, I've went into the .less files and pointed to the picture I was looking to use, but for some reason it isn't displaying.在每个文件中,我都进入了 .less 文件并指向了我想要使用的图片,但由于某种原因它没有显示。 For example:例如:

.cbx-event {
    background: url(/assets/img/shows_bg.png)no-repeat center fixed;
    -webkit-background-size: cover;
    -o-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;
    color: #ffffff;
    .cbx-inner {
        .bg-rgba(@black-color, 0.8);
        padding: 11rem 0 11.4rem;
    }

    .cbx-heading {
        h2 {
            i {
                color: @white-color;
                span {
                    background: @white-color;
                }
            }

        }
    }

that's the code that's used in my event.less file.这就是我的 event.less 文件中使用的代码。 I was told that I need to compile these .less files, which I tried to do using Koala and WinLESS.有人告诉我,我需要编译这些 .less 文件,我尝试使用 Koala 和 WinLESS 进行编译。 On both programs I receive this error when I attempt to compile:在这两个程序上,当我尝试编译时都会收到此错误:

C:\\Users.........\\themeforest-17690374-musix-music-band-html-template\\ogf\\assets\\less\\event.less NameError: variable @black-color is undefined in C:\\Users\\royal\\Desktop\\OG FIN WEB\\themeforest-17690374-musix-music-band-html-template\\ogf\\assets\\less\\event.less:14:17 C:\\Users.........\\themeforest-17690374-musix-music-band-html-template\\ogf\\assets\\less\\event.less NameError: 变量 @black-color 在 C:\\ 中未定义用户\\皇家\\桌面\\OG FIN WEB\\themeforest-17690374-musix-music-band-html-template\\ogf\\assets\\less\\event.less:14:17

13     .cbx-inner {
14         .bg-rgba(@black-color, 0.8);
15         padding: 11rem 0 11.4rem;

Sorry if this is too much detail, I'm just trying to make sure I put all the info I have.对不起,如果这太详细了,我只是想确保我提供了我拥有的所有信息。 I have some familiarity with HTML but I'm not a great coder so it may be something very simple.我对 HTML 有一些熟悉,但我不是一个伟大的编码员,所以它可能非常简单。

So as stated in the error and explained here http://lesscss.org/ YOU need to define the variables.因此,如错误中所述并在此处解释http://lesscss.org/您需要定义变量。

So before your styles, in the top of the file, or in another file with variables which you will load/import it before everything else define the colors as this:所以在你的样式之前,在文件的顶部,或者在另一个带有变量的文件中,你将在其他一切定义颜色之前加载/导入它:

@black-color: #000000;
@white-color: #FFFFFF;

And then try to compile the files.然后尝试编译文件。

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

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