web-standards

Do SVG docs support custom data- attributes?

六月ゝ 毕业季﹏ 提交于 2019-11-27 03:35:25
In HTML5, elements can have arbitrary metadata stored in XML attributes whose names start with data- such as <p data-myid="123456"> . Is this part of the SVG spec too? In practice this technique works fine for SVG docs in many places. But I'd like to know if it's part of the official SVG spec or not, because the format is young enough that there's still a lot of incompatibility between browsers, especially in mobile. So before committing to code I'd like know if I can expect future browsers to converge on supporting this. I found this message from the working group mailing list saying they

Do browsers send “\r\n” or “\n” or does it depend on the browser?

。_饼干妹妹 提交于 2019-11-27 00:32:08
问题 This question has bothered me for a million years... whenever I create a website with a textarea that allows multi-line (such as a "Bio" for a user's profile) I always end up writing the following paranoid code: // C# code sample... bio = bio.Replace("\r\n", "\n").Replace("\r", "\n"); bio = Regex.Replace(@"\n{2,}", "\n\n"); So, what do browsers send up for a <textarea name="Bio"></textarea> if it has multiple lines? 回答1: The HTTP and MIME specs specify that header lines must end with \r\n,

What's the difference between ISO 8601 and RFC 3339 Date Formats?

丶灬走出姿态 提交于 2019-11-26 23:21:34
ISO 8601 and RFC 3339 seem to be two formats that are common the web. Should I use one over the other? Is one just an extension? Do I really need to care that bad? Is one just an extension? Pretty much, yes - RFC 3339 is listed as a profile of ISO 8601. Most notably RFC 3339 specifies a complete representation of date and time (only fractional seconds are optional). The RFC also has some small, subtle differences. For example truncated representations of years with only two digits are not allowed -- RFC 3339 requires 4-digit years, and the RFC only allows a period character to be used as the

Why are HTML5 and XHTML 2 separate standards?

痞子三分冷 提交于 2019-11-26 21:10:18
问题 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? 回答1: 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

By default, JSF generates unusable IDs, which are incompatible with the CSS part of web standards

左心房为你撑大大i 提交于 2019-11-26 20:14:23
Can someone who is an active JSF (or Primefaces) user explain why by default this happens why nobody is doing anything about it: <p:commandLink id="baz" update=":foo:boop" value="Example" /> Which generates markup that cannot be used in JavaScript or CSS without hacks and should generally be considered invalid: <a href="javascript:void(0);" id=":foo:bar:baz">Example</a> The id=":bar:baz:foo" attribute here contains colons, which aren't a valid character for this attribute, at least from CSS perspective. While the attribute may be valid according to spec, it fails to work with real-world

How does one target IE7 and IE8 with valid CSS?

怎甘沉沦 提交于 2019-11-26 18:09:14
I want to target IE7 and IE8 with W3C-compliant CSS. Sometimes fixing CSS for one version does not fix for the other. How can I achieve this? Explicitly Target IE versions without hacks using HTML and CSS Use this approach if you don't want hacks in your CSS. Add a browser-unique class to the <html> element so you can select based on browser later. Example <!doctype html> <!--[if IE]><![endif]--> <!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html

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

喜你入骨 提交于 2019-11-26 18:05:17
问题 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>

content attribute of img elements

浪尽此生 提交于 2019-11-26 16:54:35
问题 While inspecting the Chrome Dev tools, I noticed the following CSS fragment: img { content: url(image-src.png); } which works perfectly in Chrome (see Screenshot below). This allows me to define the src attribute of an <img> tag via CSS. Doesn't work in Firefox. Until now I thought that is not possible to directly modify the src attribute via css and I have not found anyone talking about this. So, is this just a proprietary addition in Chrome or is Chrome implementing a W3C draft or something

Why would Google use a font tag?

折月煮酒 提交于 2019-11-26 16:20:41
问题 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"> ? 回答1: Saving a few bytes on the Google homepage likely saves them terabytes of transfer bandwidth. 回答2: In

Create a HTML table where each TR is a FORM

怎甘沉沦 提交于 2019-11-26 16:03:37
I'm trying to create a table where each row is a form. I want that each input is in a different table division, but I still need that for example, all first inputs belong to the same table head and so on. What I'm trying to do is an editable grid , more or less this: <table> <tr> <form method="GET" action="whatever"> <td><input type="text"/></td> <td><input type="text"/></td> </form> </tr> <tr> <form method="GET" action="whatever"> <td><input type="text"/></td> <td><input type="text"/></td> </form> </tr> </table> But apparently I cannot arrange the tags in that way (or so is what the w3c