Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   quotes in class/id names (http://www.velocityreviews.com/forums/t562038-quotes-in-class-id-names.html)

richard 12-18-2007 03:47 PM

quotes in class/id names
 
are the quotes in like class="name" absolutely necessary?

Harlan Messinger 12-18-2007 04:04 PM

Re: quotes in class/id names
 
richard wrote:
> are the quotes in like class="name" absolutely necessary?


In XHTML, yes. In HTML, not if the name consists of only letters,
digits, underscores, hyphens, periods, and colons.

But it's still good practice to use them. It makes your code more
readable, because inconsistency makes code more difficult to read. You
*will* need quotes, for example, for URLs that contain slashes, text
field values that include spaces, and so forth. It also makes the code
easier to write: you don't have to keep thinking, for each attribute,
"Wait, can I get by without quotes on this one?" It's more flexible
because, for example, you can use multiple classes as in
class="thisclass thatclass" without making them a special case.

Besides, why would you want to omit them?

richard 12-18-2007 04:12 PM

Re: quotes in class/id names
 
On Tue, 18 Dec 2007 11:04:35 -0500, Harlan Messinger
<hmessinger.removethis@comcast.net> wrote:

>richard wrote:
>> are the quotes in like class="name" absolutely necessary?

>
>In XHTML, yes. In HTML, not if the name consists of only letters,
>digits, underscores, hyphens, periods, and colons.
>
>But it's still good practice to use them. It makes your code more
>readable, because inconsistency makes code more difficult to read. You
>*will* need quotes, for example, for URLs that contain slashes, text
>field values that include spaces, and so forth. It also makes the code
>easier to write: you don't have to keep thinking, for each attribute,
>"Wait, can I get by without quotes on this one?" It's more flexible
>because, for example, you can use multiple classes as in
>class="thisclass thatclass" without making them a special case.
>
>Besides, why would you want to omit them?


Just curious. I've run a page I'm working on through the validator and
it doesn't seem to care about that.


All times are GMT. The time now is 12:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57