HTML - HTML标记中双引号的重要性 [英] HTML - Importance of Double Quotes in HTML Tags

查看:149
本文介绍了HTML - HTML标记中双引号的重要性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在用HTML工作一段时间,最近一个问题突然出现在我的脑海里,当给了标签

 < ; input type =textname =c-id/> 
< input type = text name = c-id />

有或没有引号时没有区别,当使用V-Studio时,此IDE不会自动加上引号,但是如果我没有记错的话,在使用Dreamweaver的时候它会自动引用引号...

我想知道的是在什么时候\\缺乏引号会产生差异或产生问题,最好的做法是什么,总是要引用引号或引用引号......



ps有很好的机会,这个问题以前曾被问过,但没有在搜索中显示过。

属性值包含空格,换行符,换页符或制表符,因为如果该值未包含在引号中,属性值将以任何一个字符结束。



从IDE的角度来看,当属性值不包含其中一个空格字符时,是否添加引号只不过是一个偏好问题。


i have been working with HTML for some time, recently a question popped in my mind that when ever give tags

<input type = "text" name="c-id" />
<input type =text name=c-id />

with or without quotes there is no difference, when working with V-Studio, this IDE doesn't put quotes automatically, but while working with the Dreamweaver if i remember correctly it does put the quotes automatically...

what i want is to know is that at what point\s the absence of quotes makes a difference or creates a problem, and what is the best practice, always go quoted or quotes-less...

p.s. there is very good chance this question has been asked before but didn't show up in the search

解决方案

It makes a difference when the attribute value contains a space, linefeed, formfeed, or tab character, because the attribute value will end at any one of those characters if the value is not wrapped in quotes.

From an IDE point of view, it's little more than a matter of preference whether to add the quotes or not when the attribute value does not contain one of those whitespace characters.

这篇关于HTML - HTML标记中双引号的重要性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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