1

I want to display meta tags in newline means when i open a site and seeing the viewsource of the site the all meta tags is displayed in oneline.

i want to display each and every meta tag in one newline.

for ex: required output:

<meta name="description" content="vvvv sdhgf dbngfsdj">
<meta name="keywords" content="dgd, sfdg, sdjgj">

but displayed output like this:

<meta name="description" content="vvvv sdhgf dbngfsdj"><meta name="keywords" content="dgd, sfdg, sdjgj">
4

2 回答 2

1

网页源代码中的换行符(或缺少换行符)直接来自网络服务器;你不能修改它们。

当您单击查看源代码时,可以编写一个浏览器扩展来插入换行符,但我认为没有任何现有的扩展可以做到这一点。

但是,您可以使用Firebug查看 HTML 页面的 DOM 树;它会做你正在寻找的东西。(在 HTML 选项卡中)

于 2010-04-21T11:44:13.350 回答
0

回答时间太长了!

但对未来的读者会很有帮助。

 this.Page.Header.Controls.Add(new LiteralControl("\r\n"));
 this.Page.Header.Controls.Add(keywords);
 this.Page.Header.Controls.Add(new LiteralControl("\r\n"));
 this.Page.Header.Controls.Add(description);
 this.Page.Header.Controls.Add(new LiteralControl("\r\n"));

注意: 以上代码适用于asp.net webpage only

于 2014-11-28T11:34:35.430 回答