2012-08-01 97 views
1

我正在設置學習目標的字符串,並使用content方法來調用和顯示這些項目。內容方法工作不正常,除非我特別聲明一個靜態字符串。這是內容方法的正確語法嗎?使用CSS字符串集屬性和內容方法

&.toc-section .listitem{ 
    display:none; 
    string-set: cnx-learning-objectives content(); 
} 

&:after { 
    display:block; 
    background-color: @green; 
    content: cnx-learning-objectives content(); 
    color: red !important; 
} 

回答

0

如果你正在嘗試設置listitem的內容納入after元素(我認爲這是你正在嘗試做的),那麼我相信這是你想要什麼:

&.toc-section .listitem{ 
    display:none; 
    string-set: cnx-learning-objectives content(); 
} 

&:after { 
    display:block; 
    background-color: @green; 
    content: string(cnx-learning-objectives); 
    color: red !important; 
} 
+0

謝謝。該解決方案奏效。 – 2012-08-02 13:58:44