Not using quotes is, IIRC, deprecated. Quotes are recommended (and hopefully soon mandated for the forgetful among us == me) for all attributes. They are currently mandatory for any attribute with a space or other special thingy in them.
t font face="Arial Rounded MT Bold"
for instance, although one should say
t font face="Arial"
and not
t font face=Arial
.
Ah -- I thought they were mandatory for all attributes already.
Ah. So I should being using quotes for everything after an =, then? So for font color as well?
Thanks for that PHP stuff Gar, I did actually know that you can use arrays in order and as associative arrays, but coming from a Perl background where one has to be a @ and the other has to be a %, it freaks me out when everything's a $.
It's like that Stephen Wright gag about the thermos: put something hot in it, it keeps it hot, put something cold in it, it keeps it cold -- but how does it
know?
OK the thing about whether stuff gets enclosed in quotes?
Technically speaking, it's about what type of characters are in the attribute's value.
[for people who may not know the terminology -- in <font color="white"> "font" is the tag, "color" is the attribute, and "white" is the attribute's value.]
If you do a syntax check, you'll get an error message for
width=50%
but not for
width=50
because "50" contains alphanumeric characters only, but the per cent sign isn't alphanumeric.
Similarly, you'll get an error for:
font color=#ffffff
but not
font color=white
for the same reason, which kind of seems wrong to me.
But this only applies to non-strict versions of HTML only, like the one we use here. Other versions require much more rigour and everything to be in quotes. Plus it always comes down to the browser's level of forgiveness anyway. Your browser might be happy with it, but not someone else's.
So ita's right, of course, always enclose things in quotes, yes. But please use the same ones at the end you use at the start...
Okay. Using quotes, and using them twice. Got it.
Thanks for that PHP stuff Gar, I did actually know that you can use arrays in order and as associative arrays, but coming from a Perl background where one has to be a @ and the other has to be a %, it freaks me out when everything's a $.
But the end() function actually did help, right? The rest was just a thought that if you did not know the end() command, you might have missed some of the other functions.
And, yeah the one thing you have to get used to in PHP is how it makes your life easier. Except when it makes your life harder. Or impossible. In short, just like any other programming language.