Jump to content

quotations for tag attributes


Recommended Posts

This is a dumb beginner question but as I begin to learn how to write html, I've looked at some examples of existing webpages and have a question about tag attributes.On some pages tag attributes are entered in quotes, in others not so and in some it is a mixture, yet they all seem to display correctly and the same in my browser. For instance, I've seen:<hr size="5" noshade="noshade" width="10%"><hr size=5 noshade="noshade" width=10%><hr size="5" noshade=noshade width="10%">etc.When is inserting " " around an attribute necessary or required and when can they be skipped, if at all?Is the answer I will receive true for all tag attributes or specific to the <hr> tag.I do realize that these attributes are being downgraded in favor of styles, but I would still like to understand the quotations system.

Link to post
Share on other sites
Its not necessary to use double quotes for values of attributes in HTML but if you want to some XHTML standard then you need to have quotes for values...HTML: http://en.wikipedia.org/wiki/HTML [section 4.3]XHTML: http://en.wikipedia.org/wiki/Xhtml [section 1.2]
Thank you both. That is what I guessed, but I wanted to find out before going too far astray.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...