什么是在翡翠中创建内联元素的简洁方法(What is a concise way to create inline elements in Jade)

系统教程 行业动态 更新时间:2024-06-14 17:02:18
什么是在翡翠中创建内联元素的简洁方法(What is a concise way to create inline elements in Jade)

我喜欢将我所有的内联元素放在一行中。

<ul> <li><a>click<span>here</span><strong>!</strong></a></li>

想知道是否有更好的方法来创建Jade中的内嵌元素:

ul li a(href="#") click span here strong !

这有点接近,但我不知道如何添加跨度和强标签,而不会打破线。

ul li: a(href='#') click span ...

这显然不是一个超大的问题,但有点恼人,我不能内联元素。 谢谢您的帮助

I like to put all my inline elements in a single line.

<ul> <li><a>click<span>here</span><strong>!</strong></a></li>

Wondering if there's a better way to create inline elements in Jade than this:

ul li a(href="#") click span here strong !

This get's a little closer but I'm not sure how to add the span and strong tags without breaking the lines.

ul li: a(href='#') click span ...

This obviously isn't a super big problem but it's a little annoying that I can't put inline elements inline. Thanks for the help

最满意答案

自1.0版以来 ,jade支持内联标签:

#[tag(attribute='value') inner stuff]

在你的情况下,将是:

ul li #[a(href="#") click #[span here #[strong !]]]

Since version 1.0, jade supports inline tags:

#[tag(attribute='value') inner stuff]

In your case that would be:

ul li #[a(href="#") click #[span here #[strong !]]]

更多推荐

本文发布于:2023-04-21 18:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d0e40d868d3bd1660e93e8582cb534af.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是在   内联   翡翠   简洁   元素

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!