在元标记中使用换行符
我想在我的网站描述元标记中使用换行符。我该怎么做,因为如果我看到源代码,它仍然只会显示
。我在代码中使用类似的东西:
<meta name="description" content="<?php echo $gotAlias ?><br/>
abc: <?php echo $got_overallrating ?>.<br/>
<a href='www.abc.com'>Visit www.abc.com</a>
">
I want to use line breaks in my website description meta tag. How do I do it, because if I see the source code it will still show <br/>
only. Something like this I use in my code:
<meta name="description" content="<?php echo $gotAlias ?><br/>
abc: <?php echo $got_overallrating ?>.<br/>
<a href='www.abc.com'>Visit www.abc.com</a>
">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为了在 AddThis 元内容标记中使用,\n 将被忽略。
所以这是行不通的。
For use in AddThis meta content tagging, the \n is ignored.
So it doesn't work.
尝试使用
"\n"
而不是
,例如;
Try
"\n"
instead of<br />
, e.g.<?php echo "first line\nsecond line"; ?>
;