Jump to content

quotations for tag attributes


htmlnewbie23
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...