继承位于另一个文件中的css类 [英] Inheriting css class which is located in another file
问题描述
我使用的是bootstrap和更少。
I am using bootstrap and less.
我想让我的类继承自bootstrap类。问题是我使用从cdn引导,并且不想在本地有任何bootsrap文件。
I want one of my class to inherit from a bootstrap class. The problem is I am using bootstrap from a cdn and don't want to have any bootsrap file locally.
可以从cdn文件导入css类使用减少或继承一个不在文件中的类。
Is it possible to import a css class from a cdn file using less or inherit a class which is not in the file ?
推荐答案
问题已经回答七相位。
The question has been answered by seven-phases-max.
少支持通过url导入文件。你只需要把它作为一个较少的文件,像这样:
Less support import of file by url. You just have to tagg it as a less file, like this :
@import (less) "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css";
示例。然后你可以引用通过url导入的类。
Example here. Then you can reference to the class imported via url.
它是工作,但继承引导类不会导入所有的类特性。我继承了所有我的输入与类.form-control。引导窗体控件的一些特性(导入(大小,圆角)和其他不引导(选择时为蓝色)。有关此此处的详情。
It is working, but inheriting a bootstrap class does not import all of the class feature. I inherited all my input with the class .form-control. Some of the features of the bootstrap form-control where imported (size, rounded corner) and others don't (blue light when selected). More about this here.
input[type="text"]{
.form-control;
width: 50%;
}
这篇关于继承位于另一个文件中的css类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!