html-validation

AngularJS app not passing official W3C HTML5 validation

倾然丶 夕夏残阳落幕 提交于 2021-02-04 15:21:06
问题 I have a project where I'm using AngularJS, but one of the requirements is that my app must pass official HTML5 and CSS3 validation. Why are apps built with AngularJS not passing official W3C HTML5 validation? I really like AngularJS, so what should I do? Do I really have to build it from scratch or is there any reasonable article/blog which address this issue so I can explain it to my professor? 回答1: According to some other Stackoverflow QA you can pre-fix your angularjs attributes with the

AngularJS app not passing official W3C HTML5 validation

别来无恙 提交于 2021-02-04 15:21:02
问题 I have a project where I'm using AngularJS, but one of the requirements is that my app must pass official HTML5 and CSS3 validation. Why are apps built with AngularJS not passing official W3C HTML5 validation? I really like AngularJS, so what should I do? Do I really have to build it from scratch or is there any reasonable article/blog which address this issue so I can explain it to my professor? 回答1: According to some other Stackoverflow QA you can pre-fix your angularjs attributes with the

'itemprop' and 'rel' attributes on same element

百般思念 提交于 2020-01-02 04:44:06
问题 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. 回答1: 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

Using sprites with IMG tag?

◇◆丶佛笑我妖孽 提交于 2019-12-28 01:50:13
问题 I understand how to use sprites, however, isn't a "src" attribute required for IMG tags? I could always use a SPAN or other tag and set the background/width/etc but it won't be semantically correct. Basically, I'd like to omit the SRC for an IMG tag and use just sprites, but am concerned about the HTML not being technically valid because of it. Thanks. 回答1: About semantical correctness: When an image has semantical meaning, so it is considered to be content, use an IMG tag , without sprites,

HTML validation error: “Non-space character in page trailer”

早过忘川 提交于 2019-12-24 00:52:58
问题 I run a W3C validation on this site. One of the error is saying this page has "non-space character in page trailer" at source code. I am not sure where to find the issue. 回答1: Maintainer of the W3C HTML Checker (validator) here. That “Non-space character in page trailer” error is caused by the “Nibbler” tool you’re using. Use https://validator.w3.org/nu/ directly instead. https://www.amberaviationacademy.com.au/courses is one of the documents that Nibbler reports that “Non-space character in

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

守給你的承諾、 提交于 2019-12-22 04:34:21
问题 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. 回答1: Yes it's valid, the HTML spec says: If the a element has no href

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",

What's a valid HTML5 document?

时光总嘲笑我的痴心妄想 提交于 2019-12-17 16:27:15
问题 I've just been reading the HTML5 author spec. It states that the <html> , <head> and <body> tags are optional . Does that mean that you can leave them out completely and still have a valid HTML5 document? If I'm interpreting this correctly, it means this should be completely valid: <!DOCTYPE html> <p>Hello!</p> Is this correct? You can check out the spec here: http://dev.w3.org/html5/spec-author-view/syntax.html#syntax "8.1.2.4 Optional tags" is the bit out about it being OK to omit <html> ,

How to Call a JS function using OnClick event

我只是一个虾纸丫 提交于 2019-12-17 15:35:04
问题 I am trying to call my JS function that I added in the header. Please find below code that shows my problem scenario. Note: I don't have access to the body in my application. Everytime I click on the element with id="Save" it only calls f1() but not fun() . How can I make it call even my fun() ? Please help. <!DOCTYPE html> <html> <head> <script> document.getElementById("Save").onclick = function fun() { alert("hello"); //validation code to see State field is mandatory. } function f1() {

Asp.Net MVC 5 Html.DropDownList is not validating

有些话、适合烂在心里 提交于 2019-12-12 01:37:34
问题 I've been stuck on this problem for a while now and can't seem to find anything online that helps. I have a Html.DropDownList in an Editor Template. I use that template in my form and don't select anything for the dropdownlist. When I click submit, I expect the form to notify me that the required dropdownlist doesn't have a value selected, but it doesn't. What am I doing wrong? Here are the View Models: public class RequestCreateViewModel { public int ID { get; set; } public