我可以有一个< pre>在< p>内标记标签在Tumblr? [英] Can I have a <pre> Tag inside a <p> tag in Tumblr?

查看:91
本文介绍了我可以有一个< pre>在< p>内标记标签在Tumblr?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我和Tumblr玩了一段时间。
我尝试将一个预先格式化的文本添加到描述段落块中,如下所示:

  {block:Description} 
< p id =description> {说明}< / p>
{/ block:Description}

然而,< pre> 元素在< p> 元素之后呈现,并且不在我的意图之内。



我在这里做错了什么,或者它是一个错误?

解决方案

元素,例如 < pre> ; ,位于 < p> 。所以Tumblr的行为是正确的。



在插入预格式化文本之前,您应该关闭您的段落。



您需要传真式文字,请尝试 < tt> 标签,但请注意它是一个非标准元素,可能无法在所有浏览器中呈现。实现格式化的正确方法是使用CSS。


today I played around a little bit with Tumblr. I tried to add a preformatted text into a description paragraph block like so:

{block:Description}
    <p id="description">{Description}</p>
{/block:Description}

However, the <pre> element gets rendered just after the <p> element and not within it which was my intention.

Am I doing something wrong here or is it a bug?

解决方案

You cannot nest block-level elements, such as <pre>, inside <p> in HTML. So Tumblr is behaving correctly.

You should close your paragraph before inserting the pre-formatted text.

If you want teletype-style text, try the <tt> tag, but note it is a non-standard element and may not render in all browsers. The correct way to achieve formatting is using CSS.

这篇关于我可以有一个&lt; pre&gt;在&lt; p&gt;内标记标签在Tumblr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆