各位,希望大家帮帮我。我已经开始设计风格,所有的东西都只有很少的网站 block 。但是当我开始为画廊编写 div 时(这里是它的代码)
body
clearfix()
text-align center
background url('./bgh1.jpg') no-repeat center center fixed
background-size(cover)
#gallery
margin-left 6%
width 88%
display block
margin-left auto
margin-right auto
height 500px
background black
#line1
width 980px
height 345px
background #ffffff
#col1
width 500px
height 500px
border 2px solid black
img
max-width 100%
max-height 100%
编译错误很多
#gallery {
margin-left: 6%;
width: 88%;
}
#gallery display block {
margin-left: auto;
}
#gallery margin-right auto {
height: 500px;
background: #000;
}
#gallery margin-right auto #line1 width 980px {
height: 345px;
background: #fff;
}
#gallery margin-right auto #line1 #col1 {
width: 500px;
height: 500px;
border: 2px solid #000;
}
#gallery margin-right auto #line1 #col1 img {
max-width: 100%;
max-height: 100%;
}
我一直在使用这个命令进行编译
stylus -w views/stylesheets/styl.styl -o views/style.css
最佳答案
Whitespace is significant [...]
您正在混合空格和制表符(即使在同一行)。即使这在您的编辑器中看起来不错,但当空格 很重要时,这可能会导致问题。因此,您应该将编辑器配置为用单个空格替换制表符以避免该问题。
关于css - Stylus 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41799427/