w3c

window.innerWidth vs document.documentElement.clientWidth

旧城冷巷雨未停 提交于 2019-12-17 15:16:40
问题 Regarding window.innerWidth and document.documentElement.clientWidth , Webkit (Chrome / Safari) claims innerWidth is smaller than clientWidth . Trident and Presto claim innerWidth is bigger than clientWidth . Gecko claims innerWidth is the same size as clientWidth . What is the correct behavior stated by W3C (or silimar "authority")? Test Script (on JSFiddle) (on GoogleHost): setInterval(function() { var inner_w = window.innerWidth; var inner_h = window.innerHeight; var client_w = document

When to use <br> line breaks vs CSS positioning?

天大地大妈咪最大 提交于 2019-12-17 09:40:04
问题 I've often wondered about the proper use of a <br> line break. Seems that often they are incorrectly used for positioning or clearing content where CSS should instead be used. W3schoools.org says to use <br> for blank lines, but not for creating or separating paragraphs. Looking over W3C HTML5 spec draft, it's a little clearer that the <br> would be used when content requires a line break such as lines of an address or blank lines in poetry, where intended by the author. But I'm still

Hex representation of a color with alpha channel?

风流意气都作罢 提交于 2019-12-17 04:58:27
问题 Is there a W3 or any other noteworthy standard on how to represent a color (including alpha channel) in hex format? Is it #RGBA or #ARGB? 回答1: In CSS 3, to quote from the spec, "there is no hexadecimal notation for an RGBA value" (see CSS Level 3 spec). Instead you can the use rgba() functional notation with decimals or percentages, e.g. rgba(255, 0, 0, 0.5) would be 50% transparent red. RGB channels are 0-255 or 0%-100%, alpha is 0-1. In CSS 4*, you can specify the alpha channel using the

What is the shortest way to pretty print a org.w3c.dom.Document to stdout?

本秂侑毒 提交于 2019-12-17 04:43:07
问题 What is the easiest way to pretty print (a.k.a. formatted) a org.w3c.dom.Document to stdout? 回答1: Call printDocument(doc, System.out) , where that method looks like this: public static void printDocument(Document doc, OutputStream out) throws IOException, TransformerException { TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); transformer.setOutputProperty(OutputKeys

Invalid CSS selector causes rule to be dropped: What is the rationale?

两盒软妹~` 提交于 2019-12-17 03:17:45
问题 I'm looking more for links to mailing list discussions, etc. rather than speculation. Can anyone help me find out the rationale behind the quoted error handling rules from the CSS Selectors Level 3 spec. User agents must observe the rules for handling parsing errors: a simple selector containing an undeclared namespace prefix is invalid a selector containing an invalid simple selector, an invalid combinator or an invalid token is invalid. a group of selectors containing an invalid selector is

Is quoting the value of url() really necessary?

一曲冷凌霜 提交于 2019-12-16 19:53:26
问题 Which of the following should I use in my stylesheets? /* Example #1: */ background-image: url(image.png); /* Example #2: */ background-image: url("image.png"); /* Example #3: */ background-image: url('image.png'); What does the W3C specify as the correct way ? 回答1: The W3C says quotes are optional, all three of your ways are legal. Opening and closing quote just need to be the same character. If you have special characters in your URL, you should use quotes or escape the characters (see

Problems in IE without doctype

五迷三道 提交于 2019-12-14 03:08:58
问题 I have a specific problem by a fixed bar. I would to use this fixedbar but I sould n't use doctype This bar in IE have problems. for example bar by scroll is not fixed and move or size of tooltips changed. In fact, my project owner don't let me to use of doctype http://ryan.rawswift.com/sandbox/jixedbar-0.0.2/demo/ Edit: Hi to all , that is right. but exceptionally, I must start html file whth "html tag" in this project! It is good that you help me to fixed this bar when scroll change. Other

HTML5 valid namespace tag prefixes

大憨熊 提交于 2019-12-13 19:21:08
问题 When validating my page, the W3-Validator gives me an error for every <tag addthis:title="AddThis share title" /> attribute in my code. How can I make those attributes valid for HTML5, so the page validates? I need those tags so addthis uses the correct titles for my sharing links, so I can't get rid of them... 回答1: You can't make them valid. Not in HTML, not in XHTML. The only valid custom attributes allowed in HTML5 start "data-". You could make your markup valid HTML5+something or XHTML5

org.w3c.dom.Node with Android version less than 2.2

佐手、 提交于 2019-12-13 14:04:49
问题 getTextContent() is not a recognized function. getNodeValue() works fine for strings, but anytime I try to parse a number using getNodeValue(), it returns null! How can I parse a Long from XML using this class? 回答1: The root cause of this is that the getTextContent() method is a W3C DOM Level 3 method; see the changes section of the DOM level 3 core spec. The Node interface has two new attributes, Node.baseURI and Node.textContent. ... and getTextContent() is the getter for the new attribute.

Property border-radius doesn't exist in CSS level 2.1 but exists in : 6px 6px

感情迁移 提交于 2019-12-13 08:55:03
问题 I am new to web design and I have some problems in my website. First, it is not a cross-browser compatible website. I want to make it so, but I don't know how to do this. I have read some articles about this, but they have not been any help. Please tell me how I can design a cross-browser website. Second, I have validated my website's CSS file and gotten these errors: 218 .box Property border-radius doesn't exist in CSS level 2.1 but exists in : 6px 6px 219 .box Property -moz-border-radius