2012-08-01 98 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