关于css的一点想法

This item was filled under [ 观点 ]

感觉Css应该要引入一个功能,类似oop里的覆盖,虽然现在的css里有这个功能了。但是不够好用啊。

比如,可以先定义一个类  

.font_style_1{
color: #f60;
font-size: 12px;
}

然后定义另一类
.div_1{
.font_style_1();
font-size: 15px;}
}

类似.font_style_1()的方法调用,其实就是相当于重用代码啦。这个可以放多个进去的
比如
.div_1{
.font_style_1();
.font_style_2();

}
后面的会覆盖前面的。
这样就更容易形成一个css框架了。

看到BP等几个css framework,感觉很别扭,有尝试用进去,但是绝对很麻烦,还不如自己写。

Bookmark and Share

喜欢这篇文章的人还喜欢。。。

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Comment on “关于css的一点想法”

Leave a Comment