2017-01-23 27 views
0

大家,希望你能幫助我。我已經開始設計風格,而且所有的東西都只有幾塊網站。但是,當我開始寫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 

回答

1

Selectors: Indentation

Whitespa [...]

您正在混合空格和製表符(甚至在同一行上)。即使這在編輯器中看起來不錯,當空白顯着時,這可能會導致問題。所以你應該配置你的編輯器來替換帶有單個空格的選項卡以避免這個問題。