web-standards

Multiple CSS Classes: Properties Overlapping based on the order defined

限于喜欢 提交于 2019-12-28 02:42:26
问题 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

Regular String to IDNA in Java

南笙酒味 提交于 2019-12-25 09:55:14
问题 Is there a library that is able to parse Unicode domain name into IDNA? Like שלום.com ==> http://xn--9dbne9b.com/ ? 回答1: java.net.IDN seems to do the trick. From my Scala console: scala> java.net.IDN.toUnicode("xn--9dbne9b.com") res0: java.lang.String = שלום.com Note that it works on the hostname, not the URL. So you'll have to strip/extract the http:// protocol first. A quick glance at the documentation reveals it works in the opposite direction too. From above (my Unicode hostname in the

Are CSS child selectors a W3C standard?

守給你的承諾、 提交于 2019-12-25 06:36:32
问题 Child selectors like this: #id > a { background-color: blue; } Doesn't seem to be referenced on the w3schools css website. Is it bad practice? 回答1: Is it bad practice? No, but it is not supported by IE6, which still is kind of a limitation for some sites. 回答2: Yes, they're in the standard. http://www.w3.org/TR/CSS21/selector.html#child-selectors As mentioned they don't work on IE6 though. If you can grab metrics from your site and determine if the proportion of IE6 users is worth the extra

Capturing microphone input through HTML5 [closed]

久未见 提交于 2019-12-24 03:29:51
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . If I get it right, this will be achieved through the HTML5 JavaScript API navigator.getUserMedia() in the future. As of this date, what browsers support it? Beta, alpha, build from source.. How can I play around

Why are double hyphens invalid in HTML comments? [duplicate]

我与影子孤独终老i 提交于 2019-12-23 07:29:36
问题 This question already has answers here : double hyphen in script makes firefox render strangely (3 answers) Closed 5 years ago . Standards mode HTML forbids double hyphens in comments. <!-- This is a perfectly valid comment - I think. --> <!-- Invalid comment -- definitely. --> There are three additional restrictions, exemplified by these invalid examples: <!--> invalid --> <!---> invalid --> <!-- invalid ---> Why bother specifying all these little edge cases? In particular, why forbid double

How long may parameters in a get request be?

假装没事ソ 提交于 2019-12-23 07:07:06
问题 I am currently programming an API that gets passed data via get parameters so I was wondering if the total length of the URL or of the parameters value is limited in best practice or by the protocol. 回答1: Basically, 2K is the most you can rely on in a cross-browser fashion, but if you drop support for IE 8 and below, you can get to like 64K. Although I feel I need to question your need to know this, anything over say.. 100 characters would best be handled through a POST request instead of a

Strict doctype - form and input element

本秂侑毒 提交于 2019-12-22 05:13:11
问题 Does anyone know the reasoning behind the strict doctype not allowing input elements to be direct descendents of a form element. I find it annoying that i have to wrap a submit button which is a block level element inside another block level element say a fieldset or a div. However, I cannot find an answer anywhere as to why this actually is. 回答1: So if you try to put an input directly into a form without a container element, and validate under xhtml 1.0 strict, you get this warning: document

Ampersands in hyperlinks cause W3C validation to fail

倾然丶 夕夏残阳落幕 提交于 2019-12-20 02:30:50
问题 I have a reacurring problem. I code nice standards compliant code only to have it fail due to ampersands within some of the hyperlink urls. Does anyone know of a work around or hack for this. Thanks 回答1: You should URL Encode the hyperlinks, so all characters are turned into a valid ASCII format and don't contain any (X)HTML entities. For C# use HttpUtility.UrlEncode, for PHP urlencode, for JavaScript encodeURI , etc... Finding the right method for the language you're using shouldn't be that

Ampersands in hyperlinks cause W3C validation to fail

耗尽温柔 提交于 2019-12-20 02:30:37
问题 I have a reacurring problem. I code nice standards compliant code only to have it fail due to ampersands within some of the hyperlink urls. Does anyone know of a work around or hack for this. Thanks 回答1: You should URL Encode the hyperlinks, so all characters are turned into a valid ASCII format and don't contain any (X)HTML entities. For C# use HttpUtility.UrlEncode, for PHP urlencode, for JavaScript encodeURI , etc... Finding the right method for the language you're using shouldn't be that

Why are CSS3 PIE and other similar scripts not in use everywhere?

…衆ロ難τιáo~ 提交于 2019-12-18 17:32:33
问题 This question has already been asked at htc files: Why not to use them?, but the answer didn't answer anything really. The question is, why is something like CSS3 PIE not in use on many sites? I'd expect smaller ones to not know about it, but the one that caught my eye was Twitter, who doesn't use it. Is it because it's not standard? Or does it cause a noticeable slow-down of the site? Thank you for any responses. 回答1: I can't speak for everyone, but my sense is that you don't see tools like