用于 zen 编码的父选择器
我刚刚发现了禅宗编码。
我想生成以下代码片段。
<div id="base">
<div id="header">
<div id="logo"></div>
</div>
<div id="body"></div>
<div id="footer"></div>
</div>
有没有一种方法可以用一行禅宗代码来做到这一点,
我知道我可以写
div#base>div#header>div#logo
这就是我陷入困境的地方,因为我不知道如何返回并添加正文和页脚 div(标题的兄弟姐妹)。
我想弄清楚这是否/如何可以在一行中完成。
谢谢! :)
I just discovered zen-coding.
I have the following snippet of code I want to generate.
<div id="base">
<div id="header">
<div id="logo"></div>
</div>
<div id="body"></div>
<div id="footer"></div>
</div>
Is there a way to do this with one line of zen-code
I know I can write
div#base>div#header>div#logo
this is where I get stuck, cause I don't know, how I can go back and add body and footer divs(siblings of header).
I want to figure out if/how this can be done in one line.
Thanks! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了 Jonathon Bolster 的答案:
爬上父标签/树的其他技巧:
emmet ( zencoding 的后继者)
源中的运算符:
http://docs.emmet.io/cheat-sheet/
或者您可以从sparkup (zencoding 的分支)
来源:
https://github.com/rstacruz/sparkup
addition to Jonathon Bolster's answer:
other trick for climb up parent tag / tree:
from emmet ( successor of zencoding )
source:
http://docs.emmet.io/cheat-sheet/
from sparkup ( fork of zencoding )
source:
https://github.com/rstacruz/sparkup
这对我来说适用于 ZenCoding for Notepad++
This works for me with ZenCoding for Notepad++