Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

pug - Jade (node.js) - more than one class on an element?

in jade one can write:

div.container

and it compiles into:

<div class="container"></div>

But what if you have several classes like:

<div class="span 4"><div>

I have written it like this:

div(class="span 4")

But I am thinking: Is there not a better way of doing it in jade?

question from:https://stackoverflow.com/questions/9750749/jade-node-js-more-than-one-class-on-an-element

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From the documentation:

how about some classes?

div.user-details

renders <div class="user-details"></div>

multiple classes? and an id? sure:

div#foo.bar.baz

renders <div id="foo" class="bar baz"></div>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...