重新格式化 HTML

发布于 2024-09-10 17:38:11 字数 506 浏览 5 评论 0原文

我不是开发人员,所以我不知道正确的术语。 我正在处理其他人完成的代码,并且它是以连续的方式编码的。意思不是这样,

<body>
   <ul>
       <li>List 1</li>
       <li>List 2</li>
       <li>List 3</li>
   </ul>
</body>

而是像这样,连续地:

<body><ul><li>List 1</li><li>List 2</li><li>List 3</li></ul></body>

现在我的问题:Adobe Dreamweaver 有没有一种方法或自动方法使第二个看起来像第一个?我的意思是,只需单击一下,它就会全部缩进为第一个?

I'm not a developer so I don't know the right term for this.
I am dealing with code done by other and it is coded in a continuous way. Meaning not like this,

<body>
   <ul>
       <li>List 1</li>
       <li>List 2</li>
       <li>List 3</li>
   </ul>
</body>

but instead, like this, continuously:

<body><ul><li>List 1</li><li>List 2</li><li>List 3</li></ul></body>

Now my question: is there a way or automatic way for Adobe Dreamweaver to make the second look like the first? I mean in one click it will all be indent as the first?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清醇 2024-09-17 17:38:11

多年没有使用 Dreamweaver,但发现这个网站可以帮助您..

更改代码格式

Didn't work with Dreamweaver for years, but found this site that can help you..

Change The Code Format

っ〆星空下的拥抱 2024-09-17 17:38:11

这看起来像您所追求的:

http ://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda9110b1f693f21-7bdd.html

基本查看选项 -->代码查看选项 -->自动缩进

This looks like what you're after:

http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda9110b1f693f21-7bdd.html

Basically View Options --> Code View Options --> Auto Indent

櫻之舞 2024-09-17 17:38:11

埃伦,令人惊讶的是,有多少人认为通过删除回车符和制表符可以节省大量的文件大小和加载时间。确实,您确实节省了一些……但它的效果与在奥林匹克游泳池中上厕所一样大……也就是说,不多。

作为一名 UI 人员,我痴迷于后端代码的正确缩进。它可以更轻松地发现问题并快速解决它们。为此,在我最近的工作中,我一次无情地修改了一个文件的丑陋代码,并手动格式化(添加中断和制表符)。这并不快,而且绝对不有趣。但最终的代码看起来很棒。我认为这是值得的。

Dreamweaver 不是一个糟糕的工具,但是有更好的工具可以帮助完成此任务。就我个人而言,我非常喜欢 NetBeans。它将突出显示开始/结束标签,绘制选项卡“线”,甚至自动选项卡(如果可以的话)。另一个好的工具是 Rapid PHP,它为类似上面提到的代码行提供了这个简洁的“块选项卡”工具。如果您是 HTML 新手,两者都会自动建议并即时验证您的代码,并向您显示问题所在。

如果你想变得真正疯狂,你可以控制输出代码的制表符和中断。 \t 是制表符,\n 是换行符。如果您正在处理动态创建的多级无序列表(例如菜单),那么它确实很有帮助。

祝你好运,继续学习!

Eron, it's amazing how many people think that by removing returns and tabs you can save this massive amount of filesize and load time. It's true, you do save some....but it has about as much effect as going to the bathroom in an Olympic Swimming Pool....that is, not much.

As a UI guy, I'm obsessed with correct indentation of my code on the backend. It makes it easier to catch problems and fix them quickly. To that end, in my latest job I've been mercilessly hacking away at ugly code one file at a time, manually formatting (adding breaks and tabs) as I go. It's not quick, and definitely not fun. But the finalized code looks great. It's worth it, I think.

Dreamweaver isn't a bad tool, but there's better ones out there that will help with this task. Personally, I really like NetBeans. It'll highlight start/end tags, draw tab "lines" and even auto tab if it can. Another good one is Rapid PHP, which does this neat "block tab" tool for similar lines of code like you mentioned above. If you're newer to HTML, both will auto-suggest and validate your code on the fly and show you what's wrong.

If you want to get really crazy, you can control the tabbing and breaks on outputted code. \t is a tab, \n is a line break. If you're doing work on dynamically created multi-level unordered lists such as a menu, it can really help.

Good luck, keep learning!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文