xhtml-1.0-strict

In XHTML 1.0 Strict do attribute values need to be surrounded with quotes?

丶灬走出姿态 提交于 2019-12-02 01:22:45
问题 In XHTML 1.0 Strict do attribute values need to be surrounded with quotes? Example: <input type="text" id="username"/> And if so according to the standard can single quotes be used and possible mixed with double quotes? Example: <input type='text' id="username"/> 回答1: From the XHTML 1.0 spec, they must always be quoted. All attribute values must be quoted, even those which appear to be numeric. From the HTML 4 spec, single quoted attributes are allowed. By default, SGML requires that all

In XHTML 1.0 Strict do attribute values need to be surrounded with quotes?

纵饮孤独 提交于 2019-12-01 22:07:27
In XHTML 1.0 Strict do attribute values need to be surrounded with quotes? Example: <input type="text" id="username"/> And if so according to the standard can single quotes be used and possible mixed with double quotes? Example: <input type='text' id="username"/> From the XHTML 1.0 spec , they must always be quoted. All attribute values must be quoted, even those which appear to be numeric. From the HTML 4 spec , single quoted attributes are allowed. By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks

Why aren't browsers strict about HTML? [closed]

好久不见. 提交于 2019-12-01 15:25:33
It's a well known fact that browsers will accept invalid HTML and do their best trying to make sense out of it. If you create a web page containing only the following code: <html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML</h2> <p>This is a paragraph </body> then you will get a webpage parsed in a way that will show an acceptable view. Whether it is what you meant or not, depends on each browser's understanding of your mistakes. This, to me, is the same as if Javascript could be written like this: if (some_var == 1) { say_something("some text'); else { do_something_else(); //

Why aren't browsers strict about HTML? [closed]

天大地大妈咪最大 提交于 2019-12-01 14:26:13
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . It's a well known fact that browsers will accept invalid HTML and do their best trying to make sense out of it. If you create a web page containing only the following code: <html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML</h2> <p>This is a paragraph </body> then

Ordered Lists <OL>, Starting index with XHTML Strict?

て烟熏妆下的殇ゞ 提交于 2019-11-30 15:38:57
Is there a way to start an ordered list from a specific index while following XHTML Strict? Using start=n works well, but has been deprecated … The intended purpose is to resume the index with paging. I saw a few references to a CSS solution, but the starting index cannot be used like the attribute in the deprecated case of start. Daan As kdgregory noted, counters would be the way to accomplish this and still maintain a valid document. This article on Array Studio shows how to code this in XHTML and CSS. The following is copied from their article: You need to write the following in your CSS:

Ordered Lists <OL>, Starting index with XHTML Strict?

蓝咒 提交于 2019-11-29 22:15:54
问题 Is there a way to start an ordered list from a specific index while following XHTML Strict? Using start=n works well, but has been deprecated… The intended purpose is to resume the index with paging. I saw a few references to a CSS solution, but the starting index cannot be used like the attribute in the deprecated case of start. 回答1: As kdgregory noted, counters would be the way to accomplish this and still maintain a valid document. This article on Array Studio shows how to code this in

How can I view Arabic/Persian numbers in a HTML page with strict doctype?

不羁岁月 提交于 2019-11-29 13:33:27
I have an HTML page that is right-to-left. When I don't use any doctype, my numbers are in Arabic/Persian, but when I use strict mode they turn to English. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Final//EN"> Before adding doctype: After adding doctype: also I added these meta tags to my page: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Language" content="fa" /> So how can I view Arabic numbers in a page with strict doctype (in IE because Firefox doesn't show Arabic numbers anyway)? here is a little javascript code that converts a 1234

XHTML won't validate && and < in a JavaScript function

点点圈 提交于 2019-11-29 03:42:55
Here's the snippet of code that won't validate: if (user_age > 15 && user_age < 91) It gets the following errors: XML Parsing Error: StartTag: invalid element name and XML Parsing Error: xmlParseEntityRef: no name The first error is thrown for the "less than" and the second one is thrown twice, once for each ampersand. Replacing the above signs with & and < validates fine, but of course it completely ruins the function. Or you can protect the script from the xml validation like this: <script type="text/javascript"> //<![CDATA[ if (user_age > 15 && user_age < 91) { // do soemthing } //]]> <

Nest lists in paragraphs in html

Deadly 提交于 2019-11-28 13:25:51
It seems that (strict) html doesn't allow nesting any non-inline elements inside a <p> , but then how am I supposed to render a paragraph that contains a list (something that occurs often in natural texts). I've seen three answers that all seem unsatisfying: Lists should not happen inside paragraphs. (I'm not going to go into a cultural debate, but I certainly hope that html is not going to become the place to dictate writing style.) Separate the text into a paragraph, then a list, and then a second paragraph with the post-text. This looks bad because now I have <p> chunks that are parts of

html doctype adds whitespace?

六眼飞鱼酱① 提交于 2019-11-28 08:38:59
can someone please explain to me why having a doctype of <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> and <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> render the following block differently under firefox? <table style="border-collapse:collapse; margin:0; padding:0;"> <tr> <td style="border:1px solid red; margin:0; padding:0;"><img src="http://images.smh.com.au/2010/06/01/1533814/th_park-90x60.jpg" style="border:none; padding:0; margin:0;" /></td> </tr> </table> using 'Transitional', there is no white space below the image, using 'Strict' there is! 2nd question,