xhtml

w3c validator gives 'document type does not allow element “input” here…' error

拜拜、爱过 提交于 2019-12-19 00:19:05
问题 I got this error when validating my page with w3c's validator. Source: <form action="form.php" method="post"> <input type="text"/> </form> Can someone show me why I may have gotten this error? Thanks in advance! 回答1: This answer applies to XHTML, not HTML5. The form and body element only accept block level children <form action="/"> <input type="submit"> </form> … will produce the error: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6",

Opening a link in a new tab [duplicate]

断了今生、忘了曾经 提交于 2019-12-18 20:16:20
问题 This question already has answers here : How to open link in new tab on html? (7 answers) Closed 2 years ago . I've created a website for a project I'm doing. In the content of the website there are some links for external web pages that can be visited. In the mean time when the user clicks on one of the links he'll be taken to the specified link and he will not be on the current page anymore. What I wanted to do is have the specified website in the link clicked appear in a new tab when the

What is the purpose of the `name` attribute in a checkbox input element?

谁说我不能喝 提交于 2019-12-18 18:54:13
问题 I went through many online documents for the checkbox input in XHTML. Can anyone clear my doubt? What does this name field actually stand for? Milk: <input type="checkbox" name="checkbox" value="Milk"> Chocolate: <input type="checkbox" name="checkbox" value="chocolate"> Cold Drink: <input type="checkbox" name="checkbox" value="Cold Drink"> I thought it was an identifier for that particular checkbox, which can later be used in other file by just referring their name, but given that all the

Is it valid HTML5 to use a single tag for a div?

别等时光非礼了梦想. 提交于 2019-12-18 18:47:43
问题 For example: <div/> instead of <div></div> . I did this and apparently the HTML5 validator passed this as valid. I was wondering it this is actually true? PS: I'm serving page as application/xhtml+xml 回答1: This is not valid HTML 5 (HTML does not allow shorttags, the equivalent HTML construct is a single opening div tag). It is valid XHTML 5, as it is valid XML. The reason why you might see this pass through a validator just fine is because of what you stated: PS: I'm serving page as

What is <link rel=“image_src”>

只愿长相守 提交于 2019-12-18 18:35:48
问题 Today I came across a <link rel="image_src"> tag. I don't know about it, so I use google. Google tell me that this tag are similar to og:image . So I came to open graph main site to read about it http://ogp.me/, but i found nothing about link rel="image_src" . So this tag is replacement to meta property="og:image" or is in special tag in another specification ? How use this tag or for what is used? 回答1: The rel attribute specifies the type of the link, i.e. the kind of the relationship

C# HTML from WebBrowser to valid XHTML

白昼怎懂夜的黑 提交于 2019-12-18 17:25:27
问题 So, we are using a webBrowser control in edit mode, to allow people to enter text, and then take that text and send it out to the server for everyone to see. IE, it's an HTML input box. The HTML output from that box isn't standard XHTML, given that it's just a webBrowser control, so i needed a method to convert any bad HTML to XHTML. I read up on SGML, and subsequently have used: private static string Html2Xml(string txtHtmlString) { var xhtml = new Sgml.SgmlReader(); var sw = new

Without internet connection, how xmlns attribute can work and understand by browser?

梦想的初衷 提交于 2019-12-18 16:10:30
问题 A simple XHTML document, with the minimum of required tags: and xmlns attribute has a http link. If I am working on localhost and if I don't have an Internet connection, can't I work on XHTML? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html> 回答1: The XML namespace is just there to identify elements based on a namespace, which happens to be in a URI format. See the XML Namespaces spec. In

Why can't floated elements set their left and right margins

最后都变了- 提交于 2019-12-18 15:52:21
问题 In a wrapper div, the floated elements don't seem to respond to left and right margin settings. Example: html: <div id ="wrapper"> <div id = "content"></div> </div> css: #wrapper { width: 1000px; display: block; margin-left: auto; margin-right: auto; overflow: hidden; } #content { width: 400px; height: 200px; display: block; float: left; margin-left: 30px; } The #content ignores its left margin setting. Why? 回答1: Margins do not move floated elements, they "push content away". If you want to

An error has occurred opening extern DTD (w3.org, xhtml1-transitional.dtd). 503 Server Unavailable

百般思念 提交于 2019-12-18 15:46:10
问题 I'm trying to do xpath queries over an xhtml document. Using .NET 3.5. The document looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> .... </head> <body> ... </body> </html> Because the document includes various char entities (   and so on), I need to use the DTD, in order to load it with an XmlReader. So my code looks like this:

Is the 'name' attribute considered outdated for <a> anchor tags?

六眼飞鱼酱① 提交于 2019-12-18 14:52:33
问题 Visual Studio doesn't like on-page anchor tags: Validation (XHTML 1.0 Transitional): Attribute 'name' is considered outdated. A newer construct is recommended. I'm using name attributes in this way… <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"