Answer the question
In order to leave comments, you need to log in
Why does Pug convert a div to a span if I add it inside a link?
Good afternoon, please tell me how to solve this problem?
This is
+b.A.test(href="#")
+e.content
<a href="#" class="test">
<span class="content"></span>
</a>
Answer the question
In order to leave comments, you need to log in
Pug prevents you from making the mistake of not nesting a block-level element within an inline element.
You need behavior like a block element inside an inline element - set its type through styles.
<a href="/" class="link">
<span>Link text</span>
</a>
.link span {
display: block;
}
+b.A.test(href="#")
+e.DIV.content
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question