本文介紹了LESS 中的直接子選擇器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
是否有 LESS 在其輸出中應用直接子選擇器 ( > )?
Is there anyway to have LESS apply the immediate child selector ( > ) in its output?
在我的 style.less 中,我想寫這樣的東西:
In my style.less, I want to write something like:
.panel {
...
> .control {
...
}
}
并讓 LESS 生成如下內容:
and have LESS generate something like:
.panel > .control { ... }
推薦答案
更新
實際上,原始問題中的代碼可以正常工作.你可以堅持使用 >
子選擇器.
Actually, the code in the original question works fine. You can just stick with the >
child selector.
找到答案了.
.panel {
...
>.control {
...
}
}
注意>"和."之間沒有空格,否則不起作用.
Note the lack of space between ">" and ".", otherwise it won't work.
這篇關于LESS 中的直接子選擇器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!