html-validation

W3C validator: “Element head is missing a required instance of child element title”

混江龙づ霸主 提交于 2019-12-11 07:56:41
问题 I'm trying to validate my document for HTML5 using the W3C validator at http://validator.w3.org/check. When I run the code below using "direct input" I get error messages like Element head is missing a required instance of child element title and Stray start tag html . This baffles me, because the <html> tag is right there. Why can't the validator see it? <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="description" content="some content"> <title>page title</title> </head>

Validation error: ul not allowed as child of element span

雨燕双飞 提交于 2019-12-10 15:19:14
问题 I do not understand why the WC3 validator is flagging this HTML as invalid, the error it reports back is... ''Element ul not allowed as child of element span in this context. (Suppressing further errors from this subtree.)'' I'm using HTML5, and this code is for breadcrumbs. <span class="bread"> <ul> <li><a href="./index.php">HOME</a></li> <li>ABOUT</li> </ul> </span> 回答1: <span> by definition is an inline element (so you use it inside a paragraph, for example), while <ul> is a block element

Html5 form element “required” on iPad/iPhone doesn't work

六月ゝ 毕业季﹏ 提交于 2019-12-10 12:29:58
问题 iPad safari is supposed to be html5 compliant, but it seems that the required element doesn't work. Anyone know why, or have a decent workaround that doesn't require a ton of JavaScript? My code <input type=email class=input placeholder="Email" name="email" required> 回答1: It's not supported in iOS yet: when can I use: required. 回答2: This is a jQuery solution to the issue, it highlights the input fields that have failed in a pinky colour too. $('form').submit(function(){ var required = $('

'itemprop' and 'rel' attributes on same element

依然范特西╮ 提交于 2019-12-05 09:51:05
Is it valid to use the itemprop attribute and the rel attribute on the same element? The example from Google’s Site Name documentation contains <link rel="canonical" href="https://example.com/" itemprop="url"> which gives this error in https://validator.w3.org/nu/ : Attribute rel not allowed on element link at this point. It depends on the specification. Microdata, where the itemprop attribute is coming from, is defined by WHATWG’s HTML as well as by W3C’s HTML Microdata . The WHATWG version is a living standard without snapshots (so things might change; my quotes are from 2015-07-25), the W3C

Is it valid HTML to have an anchor tag without href and without name?

a 夏天 提交于 2019-12-05 04:04:32
Is it valid HTML to have an anchor tag without href and without name? In our app we have some delete links which are disabled (hence no href attribute), but still shown to the user. I am posting this question on behalf of Joshua Muheim which was asked in the comments of a related question . It is very similar to the original question, but different enough that I felt it was worthwhile to open it as a separate question. Yes it's valid, the HTML spec says : If the a element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it

Help with HTML validation error: Table column has no cells beginning in it

…衆ロ難τιáo~ 提交于 2019-12-04 02:52:47
问题 Please help me with this validation error. I can't understand what it means or what's not standards complaint with my HTML. I'll repost it here since hopefully I'll fix it and that link will no longer work: Table column 2 established by element td has no cells beginning in it. …="tooltip_table"><tr><td colspan="2">20 yd range</td></tr><tr><td colspan="2" ↑ 回答1: HTML 5.2 Draft: Section 4.9.12.1 Forming a table http://w3c.github.io/html/tabular-data.html#forming-a-table Step 22: If there exists

No p element in scope but a p end tag seen.w3c validation

こ雲淡風輕ζ 提交于 2019-12-03 05:32:02
问题 My HTML is as as below. I have opened all elements and closed them. Still when I check it on w3c it shows error. I cant figure it out. <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <p> <div class="inr_content clearfix"> <div class="col2 first fl"> to provide a drive-in services. </div> <div class="col2 last fr"> to provide a drive-in services. </div> </div> </p> </body> </html> 回答1: That's because you are nesting a block level element

No p element in scope but a p end tag seen.w3c validation

我的未来我决定 提交于 2019-12-02 17:52:54
My HTML is as as below. I have opened all elements and closed them. Still when I check it on w3c it shows error. I cant figure it out. <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <p> <div class="inr_content clearfix"> <div class="col2 first fl"> to provide a drive-in services. </div> <div class="col2 last fr"> to provide a drive-in services. </div> </div> </p> </body> </html> That's because you are nesting a block level element inside the p tag which is invalid. You can only nest inline elements such as span , a and img inside p tag. So

Help with HTML validation error: Table column has no cells beginning in it

南楼画角 提交于 2019-12-01 15:00:44
Please help me with this validation error. I can't understand what it means or what's not standards complaint with my HTML. I'll repost it here since hopefully I'll fix it and that link will no longer work: Table column 2 established by element td has no cells beginning in it. …="tooltip_table"><tr><td colspan="2">20 yd range</td></tr><tr><td colspan="2" ↑ HTML 5.2 Draft: Section 4.9.12.1 Forming a table http://w3c.github.io/html/tabular-data.html#forming-a-table Step 22: If there exists a row or column in the table containing only slots that do not have a cell anchored to them, then this is a

Does a <tr> have to be inside a <tbody>

末鹿安然 提交于 2019-12-01 03:49:50
Does a table row ( <tr> ) have to be in a table body ( <tbody> ), if the table has a table body, or can it exist outside of the table body? <table> <tr> <td colspan='2'>...</td> </tr> <tbody> <tr> <td>...</td> <td>...</td> </tr> </tbody> <tr> <td colspan='2'>...</td> </tr> <tbody> <tr> <td>...</td> <td>...</td> </tr> </tbody> </table> No, the <tr> can be in the <thead> , <tbody> , <tfoot> or it doesn't have to be in any of them. Contrary to what Terrill Thomson said, a table with <tr> tags outside of the <thead> , <tfoot> and <tbody> tags but inside the <table> tags will validated against the