我的 HTML 在被浏览器解析后不知何故搞砸了。
这是我的输入:
<a href="/quotes/{{ $quote->id }}" style="text-decoration: none; color: inherit; display: block">
<blockquote>
<p id="quote-{{ $quote->id }}-text">{{ $quote->quote }}</p>
<small class="author" id="quote-{{ $quote->id }}-author">
<a href="/authors/{{ $quote->author->username }}">{{ $quote->author->name }}</a>
</small>
</blockquote>
</a>
这是我从 Chrome 开发工具中得到的输出:
<body>
<a href="/quotes/{{ $quote->id }}" style="text-decoration: none; color: inherit; display: block">
</a> <!-- Why is it closing this tag over here? -->
<blockquote><a href="/quotes/{{ $quote->id }}" style="text-decoration: none; color: inherit; display: block">
<p id="quote-{{ $quote->id }}-text">{{ $quote->quote }}</p>
<small class="author" id="quote-{{ $quote->id }}-author">
</small></a><small class="author" id="quote-{{ $quote->id }}-author"><a href="/authors/{{ $quote->author->username }}">{{ $quote->author->name }}</a>
</small>
</blockquote>
</body>
问题是浏览器a
在解析 html 时关闭了标签,我认为,并且不再blockquote
被包装a
。如何将标签包装blockquote
在a
标签中?
谢谢!