2012-02-18 84 views
-1

我的HTML代码,看起来所有捣碎,如:如何添加换行符在冗杂的HTML代码

<html><head> <script type="text/javascript"> window.onload = runJcript('fixads()');</script> <link rel="stylesheet" href="http://wik253.googlecode.com/files/jquery.ui.all.css" type="text/css"> <link rel="stylesheet" href="http://wik253.googlecode.com/files/main5.css" type="text/css"> </head><body></body> 

这是非常难以阅读和一起工作,有没有办法将其带到正确的格式如:

<html> 
<head> 
<script type="text/javascript"> window.onload = runJcript('fixads()'); 
</script> 
<link rel="stylesheet" href="http://wik253.googlecode.com/files/jquery.ui.all.css" type="text/css"> 
<link rel="stylesheet" href="http://wik253.googlecode.com/files/main5.css" type="text/css"> </head> 
<body> 
</body> 
</html> 

所以它更具可读性和可操作性。 他们是一个工具或在线脚本,可以帮助我做到这一点?

感谢, Praney

+1

得到一个IDE,为你做到这一点,就像Aptana Studio的'CTRL + SHIFT + F' – Joseph 2012-02-18 22:29:36

+1

一个快速的Google HTML格式化程序,只需要它... – 2012-02-18 22:30:51

+0

@Joseph谢谢。 – praneybehl 2012-02-18 22:41:02

回答

2

如果您使用编写的文本编辑器进行编码,编辑器通常具有清理缩进的功能。在Kate中,您可以在“工具”>“清洁缩进”下找到该功能。

如果生成HTML,你可以在HTML整洁看一看:http://tidy.sourceforge.net/

+0

谢谢你,我找到了一个在线脚本很容易做到这一点: http://www.freeformatter.com/html-formatter.html 所以,如果有人正在寻找他们可以检查出来的一样太。 – praneybehl 2012-02-18 22:44:38

0

您可以使用HTML整洁,有超过here的在线版本。 或者您可以下载它在您的应用程序中使用here

许多IDE都有像Dreamweaver这样的清理选项。

+0

谢谢你的回复 – praneybehl 2012-02-18 22:55:57