Those are all rubbish. But let's assume you simply forgot to include
the element name.
<table width=250>, etc.
In this case they are all correct. The space between the = and the
value makes no difference (nor does a space between attribute name and
the =).
However, not all values can be left unquoted. See
http://www.w3.org/TR/html401/intro/sgmltut.html#idx-attribute-6 for
the rules on when attribute values must be quoted.
In XHTML attribute values must always be quoted.
What are the HTML elements in question? font is not an attribute of
any HTML element, so your first example makes no sense. The font
element is also long deprecated and there is no need to use it in
pages created in 2003 so you second example is a diversion from the
real question.
Mark your content up with the appropriate HTML elements, adding those
attributes that actually exist for those elements and which are either
mandatory or needed by your content.
If you have a specific example where you can not decide whether to use
an attribute or not please post it.
Thanks for your reply. My examples were poorly chosen, but I was
trying for examples where the part of the line that was not in
question would not distract. So, I deliberately left out the img
src attribute. I just wasn't thinking when I put the font size in
that same line. These are not real lines that I'd use. Just trying
for an example.
Let me try again...if the sets to be included are
font face="arial, helvetica"
font size ="6"
bold
bgcolor="#cccccc"
and so on, what would the best way to handle it. Each could be within
< >, or several could be within the < >. Which is better, and why?
There is no particular combination that I'm asking about. I'm just
looking for a general rule for what should be in one set of < >. If
you reply to this, try to stay away from the example (which may be a
bad one) and reply to the concept which is "what can be included in
one set of < >?" (when it pertains to the same general thing)
As to the font element being deprecated, I've been using "font size=
x". It works, I've never seen a real reason not to use it. I don't
need or use CSS since I'm really not doing a web page, but just a
small ad with a short life.
I'm a little surprised at the intensity of comment over this. If
something works, and it doesn't interface with anything else, why is
it a problem? I'm not trying to argue about it, but really curious
about why it's a concern.
To run on a bit, I started with HTML a couple of months ago, and - yes
- I learned what I have learned from a book and from some on-line
tutorials.
The problem with learning this way is that each step is presented
separately. The book says if you want the font to be bold, you write
<b> on one side and </b> on another. Later, the book says if you want
the font to be italic, you write <i> on one side and </i> on the
other. The book never says it's best, or not right, to write <b i> if
you want both. The book doesn't tie one thing into the next thing.
Trial and error says that doesn't work, but each combination then
becomes trial and error. So, the question here is to try to determine
some rule of thumb that saves the trial and error process from each
combination.
The second problem with learning from a book is that the average book
is $30 to $50, and out of date quicker than a woman's hem line. When
you are not employed in the field, and just doing small projects, you
end up using whatever is in that book (ie: font size="x") as long as
it works. Ask a question based on that level, and people come down
on you.