|
-
Mar 23rd, 2006, 04:25 AM
#1
Thread Starter
transcendental analytic
is this valid HTML?
<ul><li><font color="#FF8080">item 1</li><li>item 2</li><li>item 3</font></li></ul>
or typically anything of this form: <A><B></A></B>
it occurs here
http://www.vbforums.com/showthread.php?t=352267
Opera, IE and FF seem to handle it just fine, but is that HTML?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Mar 23rd, 2006, 04:56 AM
#2
Frenzied Member
Re: is this valid HTML?
kedaman:
Yes it is HTML and it displays a list:
item 1
item 2
item 3
in red text.
-
Mar 23rd, 2006, 05:10 AM
#3
Re: is this valid HTML?
 Originally Posted by kedaman
<ul><li><font color="#FF8080">item 1</li><li>item 2</li><li>item 3</font></li></ul>
or typically anything of this form: <A><B></A></B>
it occurs here
http://www.vbforums.com/showthread.php?t=352267
Opera, IE and FF seem to handle it just fine, but is that HTML?
No no no, that HTML is not valid. It is badly formed. Tags should be closed in the oppisite order to which they are opened. Also, in the most recent version of HTML, the font tag has been deprecated.
.e.g:
<b><i>hello</b>how are you</i>
Is not well formed.
<b><i>Hello</i> how are you</b>
Is well formed.
The corrected version should look like this. You would use CSS, in the parent ul element to set the font color for ALL child elements.
HTML Code:
<ul style="color: #FF8080">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
-
Mar 23rd, 2006, 07:27 AM
#4
Addicted Member
Re: is this valid HTML?
try
HTML Code:
<font color="#FF8080">
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
</font>
I've had enough with sainity!
What's the use of it anyway?
-
Mar 23rd, 2006, 07:52 AM
#5
Re: is this valid HTML?
 Originally Posted by Lemon Lime
try
HTML Code:
<font color="#FF8080">
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
</font>
No, you shouldn't. I realise that vBulletin and other forum systems spew them out, but the font tag no longer exists.
kedaman - FYI - Non-well formed HTML causes the UA to trigger "quirks mode" (otherwise known as tag soup, referring to the incorrectly nested tags) rendering. This has severe effects in Internet Explorer, where "standards mode" rendering is very much more faithful to the W3C standards than quirks mode (although that does not say much). This is more for historical reasons than anything.
To use proper standards mode the page must include a valid doctype and be well formed HTML. Missing things like end </p> and </li> tags is acceptable (but not advisable) as that is valid in HTML 4.
-
Mar 23rd, 2006, 08:27 PM
#6
<?="Moderator"?>
Re: is this valid HTML?
You can check if your html is valid yourself by using W3C's very useful tool.
http://validator.w3.org/
-
Mar 23rd, 2006, 10:45 PM
#7
Thread Starter
transcendental analytic
Re: is this valid HTML?
Thanks people, for all your help. In the example, the first item is displayed in red while the rest have the original colour, including the first bullet, which seems odd because all items are within the tags still. Does this "quirks mode" end all unclosed tags when an open tag that is not the inner most tag is closed, while ignoring close tags that are not inner most?
john tindell: thanks for the link. An amazing amount of errors found in the page i refered to - 324. Btw, how come <BR /> is not valid html?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Mar 24th, 2006, 12:00 AM
#8
Re: is this valid HTML?
Quirks mode behaviour is completely up to the browser. The rendering behaviour for invalid HTML is explicitly unspecified by the HTML standard. However, in valid HTML, a number of tags can be closed by other tags - e.g. <p>, <table>, <div> can close a preceding <p>. So it's likely that an opening <li> is closing a <font> tag that was opened within the previous <li> element.
<BR /> is not valid HTML, <BR> is. The self-closing syntax is an XML feature, so it is not applicable in HTML. In SGML (HTML's base language), strictly, it should produce a line break plus a > sign, for whatever reason. But no UA does this.
BTW, the more you go into the details of this stuff, the more you realise why it's impossible to practically apply a completely compliant SGML+HTML parser for documents on the web. Out of all pages on the web, probably only a relative handful are valid.
-
Mar 24th, 2006, 02:09 AM
#9
Thread Starter
transcendental analytic
Re: is this valid HTML?
Ok, so Quirk mode isn't a pseudo html standard, but rather a browser's way of handling invalid html that is widely used anyway, and because of this people continue to use deprecated html code, which in turn means that browsers continue to support invalid html.. now what's the point with the standard? Are these quirk behaviours documented anywhere so you can tell how browsers will react to invalid html?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Mar 24th, 2006, 03:51 AM
#10
Re: is this valid HTML?
Exactly. Now when proper XHTML (sent with an XML mime type, not text/html) becomes the widely used standard instead of HTML, people will not be able to get away with such dodgy code as it must be well formed XML. Until then, we are stuck with how it is now.
As for documentation, try www.quirksmode.org - not sure how much of it actually refers to quirks mode, but still.
-
Mar 24th, 2006, 05:06 AM
#11
Re: is this valid HTML?
 Originally Posted by kedaman
Btw, how come <BR /> is not valid html?
it is valid in xhtml, as penagate said. since internet explorer (version 6) doesnt support the "application/xhtml+xml" mime-type, you can always just use the "text/html" mime-type for xhtml web pages (if they dont contain any xml code). and a reminder that all tags/attributes in xhtml are lowercase.
-
Mar 24th, 2006, 09:30 AM
#12
Re: is this valid HTML?
Can XML tags/attributes contain underscores?
-
Mar 24th, 2006, 09:40 AM
#13
Re: is this valid HTML?
 Originally Posted by visualAd
Can XML tags/attributes contain underscores?
Strictly, but I would advise the use of dashes (-) instead.
The standard is fairly terse, but if you're up for it:
http://www.w3.org/TR/REC-xml/#sec-common-syn
 Originally Posted by tr333
you can always just use the "text/html" mime-type for xhtml web pages (if they dont contain any xml code).
You may do that with XHTML 1.0 Transitional. You should not not do that with XHTML 1.0 Strict, or (especially) XHTML 1.1. The latter two must be served using an XML mime type (application/xhtml+xml, preferably, application/xml, or text/xml).
http://www.w3.org/TR/xhtml-media-types/
Last edited by penagate; Mar 24th, 2006 at 09:44 AM.
-
Mar 24th, 2006, 10:52 AM
#14
Re: is this valid HTML?
 Originally Posted by penagate
You may do that with XHTML 1.0 Transitional. You should not not do that with XHTML 1.0 Strict, or (especially) XHTML 1.1. The latter two must be served using an XML mime type (application/xhtml+xml, preferably, application/xml, or text/xml).
http://www.w3.org/TR/xhtml-media-types/
does IE7 support the xhtml mime-type? without IE support, there isn't much point using it since most people won't be able to view an xhtml page.
-
Mar 24th, 2006, 11:22 AM
#15
Re: is this valid HTML?
Standards are great, but they need to be supported by the majority.
-
Mar 24th, 2006, 12:05 PM
#16
Re: is this valid HTML?
 Originally Posted by tr333
does IE7 support the xhtml mime-type? without IE support, there isn't much point using it since most people won't be able to view an xhtml page.
No. You should not serve XHTML in any flavour to IE, it is not supported.
I use XHTML 1.1, but converted on the fly to HTML 4 for UAs that do not explicitly advertise their support for application/xhtml+xml.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|