如何使HTML代码与评论不活动 [英] How to make HTML code inactive with comments

查看:98
本文介绍了如何使HTML代码与评论不活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上有一些HTML代码,我不想擦除,但在短期内无效。我怎样才能让浏览器忽略页面的某些部分,就像 // 在某些编程语言中的工作方式一样?

解决方案

注意HTML评论:

 <! -  comment  - > 

http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML



删除代码而不删除代码的正确方法当然是使用版本控制,它使您能够恢复过去的旧代码。不要养成在页面中累积注释代码的习惯,这并不好玩。 :)

I have some HTML code on a page that I don't want to erase, but make inactive for the short term. How can I make the browser ignore parts of the page in the same way the // works in some programming languages?

解决方案

Behold HTML comments:

<!-- comment -->

http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML

The proper way to delete code without deleting it, of course, is to use version control, which enables you to resurrect old code from the past. Don't get into the habit of accumulating commented-out code in your pages, it's no fun. :)

这篇关于如何使HTML代码与评论不活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆