div之外的段落?

时间:2015-07-21 14:38:52

标签: html css

这是一个在没有实际显示问题的情况下难以解释的问题。

我们从view-source开始: View-source

一切都应该在里面< p为H.而是关闭< p为H.。

我的代码:

<p>'.bbCode($Posts['content'], $Posts['id']).'</p>';

以及创建引号的preg_replace:

$text = preg_replace('/\[quote=([^\]]+)?\]/is', '<div class="quote"><strong>$1 skrev:</strong><br />', $text);
$text = preg_replace('/\[quote[^\]]+\]/is', '<div class=\"quote\"><br />', $text);
$text = preg_replace('/\[\/quote\]/is', '<br clear=\"all\" /></div>', $text);

2 个答案:

答案 0 :(得分:0)

浏览器正在尝试更正无效标记。您正尝试将一些块元素插入p。两种解决方案:将p更改为sectionarticlediv或其他内容或从html标记中删除帖子。

答案 1 :(得分:-1)

使用span而不是div。

<span class="makeSomeCoolFormattedText"> My Awesome Text </span>
相关问题