web-standards

Why are HTML5 and XHTML 2 separate standards?

放肆的年华 提交于 2019-11-27 22:49:14
Is there a reason why these two standards are being developed separately? They seem to be solving the same problem but what are the differences and, if they are to remain separate, what roles are they expected to take in web development in the future? Browser vendors care a great deal about backwards compatibility. The group speccing XHTML2 didn’t. Note that XHTML2 isn’t solving all the same problems HTML5 is solving. HTML5 is much broader in scope than XHTML2. HTML5 covers processing models, JavaScript APIs, video, audio, application widgets, etc. but XHTML2 does not. As for expected roles,

Can we place `<img>` inside `<h1>` according to web standards?

有些话、适合烂在心里 提交于 2019-11-27 19:35:00
Can we place <img> inside <h1> according to web standards? like this <h1> Demo text <img src="anyimage.jpg"/> </h1> Yes, you can - the DTD says: <!ELEMENT h1 %Inline;> <!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % special "%special.pre; | object | img "> That basically means h1 can contain %Inline , which is made of various things, including img Look who is using it: http://www.w3.org/ <h1 class="logo"><a tabindex="2" accesskey="1" href="/"><img src="/2008/site/images/logo-w3c-mobile-lg" width=

Multiple Forms With Input Fields With The Same Name Attribute? Good Or Bad?

与世无争的帅哥 提交于 2019-11-27 17:13:16
问题 Is it an acceptable practice to have multiple HTML forms on a page with input fields that share the same name attribute? For example, the page contains a listing of all players and users are allowed to vote for the best player so next to each player card there is this form: <form class="vote-for-player" enctype="application/x-www-form-urlencoded" method="post" action="/index/vote-for-best-player"> <input type="hidden" name="player_id" value="1" /> <input type="submit" name="vote_for_player"

Why would Google use a font tag?

一世执手 提交于 2019-11-27 13:26:15
So, I couldn't help noticing while demonstrating Chrome's DOM browser thing to my brother, that Google uses a <font size=-2> tag. I know this is a stupid question, but from a programming point of view--why would they use a deprecated tag on Google? Is it because it's smaller than using <p class="whatever"> and then creating a style for it, or just going <p style="font-size: x-small"> ? Saving a few bytes on the Google homepage likely saves them terabytes of transfer bandwidth. In November 2005, Matt Cutts , a Google software engineer, said: Google’s home page doesn’t validate and that’s mostly

Is it ok to use <strong> in place of <b> blindly?

女生的网名这么多〃 提交于 2019-11-27 11:46:18
Note: I know <b> is presentational and <span style="font-weight:bold> is a better way, and <strong> and <em> are for emphasis but my question is not regarding this. Should we convert every <b> to <strong> blindly? Many people do this, they think <b> is not good as per web standards so they convert every <b> to <strong> upon site redesign, content re-population, new site design and people suggest this to others also. Dreamweaver has also given the option to convert all <b> and <i> to <strong> and <em> on code paste in design view and when we use B and I Which people use blindly. alt text http:/

Correct use of Blockquote, q and cite?

和自甴很熟 提交于 2019-11-27 10:15:15
问题 Is this the correct use of Blockquote , q and cite ? <p> <blockquote>Type HTML in the textarea above, <q>and it will magically appear</q> in the frame below. </blockquote> <cite><a href="http://stackoverflow.com">refrence url</a> </p> Is use of Blockquote , q semantically correct? or both are presentational element , so should not be used? 回答1: Yes. They are not presentational elements — blockquote represents a block quotation, q represents an inline quotation, and cite represents a reference

What elements can a span tag contain in HTML5?

雨燕双飞 提交于 2019-11-27 07:58:37
So I have been a CLI or Cron developer in PHP for most my career and now I am learning why I did not like UI work in school ;) I am dealing with HTML5 validation here and I am not finding an answer to a question that is for curosity. I ran the W3C HTML5 validation on my home page and I got several errors around a div being within a <span> and that is not allowed. I tried changing all <div> within spans to a <p> but recieve pretty much the same error. http://www.w3schools.com/html5/tag_span.asp does not explicitly say what elements are allowed within a <span> and neither does the error from the

Multiple CSS Classes: Properties Overlapping based on the order defined

99封情书 提交于 2019-11-27 07:22:35
Is there a rule in CSS that determines the cascading order when multiple classes are defined on an element? ( class="one two" vs class="two one" ) Right now, there seems to be no such effect. Example: both divs are orange in color on Firefox <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style> .one { border: 6px dashed green } .two { border: 6px dashed orange } </style> </head> <body> <div class="one two"> hello world </div> <div class="two one"> hello world </div> It depends on which one is declared last in your stylesheet. For

Valid content-type for XML, HTML and XHTML documents

扶醉桌前 提交于 2019-11-27 06:51:10
What are the correct content-types for XML, HTML and XHTML documents? I need to write a simple crawler that only fetches these kinds of files. Nowadays http://example.net/index.html can serve for example a JPEG file due to mod_rewrite, so I need to check the content-type from response header and compare it with a list of allowed content-types. Where can I get such a list from? HTML: text/html , full-stop. XHTML: application/xhtml+xml , or only if following HTML compatbility guidelines, text/html . See the W3 Media Types Note . XML: text/xml , application/xml ( RFC 2376 ). There are also many

Can we place `<img>` inside `<h1>` according to web standards?

随声附和 提交于 2019-11-27 04:23:24
问题 Can we place <img> inside <h1> according to web standards? like this <h1> Demo text <img src="anyimage.jpg"/> </h1> 回答1: Yes, you can - the DTD says: <!ELEMENT h1 %Inline;> <!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % special "%special.pre; | object | img "> That basically means h1 can contain %Inline , which is made of various things, including img 回答2: Look who is using it: http://www.w3