0
Block Elements in Inline Elements
There is no html validation error when I place a block element inside an inline element. Why is that?
5 ответов
+ 3
yushan fernando
Validator is working fine. There is no warning because html5 standards allow both inline and block level tags to be nested within an anchor tag.
https://www.bennadel.com/blog/3693-anchor-tags-can-contain-block-level-elements-as-of-html5.htm
+ 2
Sololearn will not give errors or warning messages. Even our browsers don't ^.^
How can we expect a <10mb app to do all this?
You can use https://validator.w3.org/ for validating your codes.
+ 2
yushan fernando ,
It works. I think you just don't know how to use it.
Try this input
<span><div>lorem </div></span>
Output :
""'
Error: Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
From line 1, column 7; to line 1, column 11
<span><div>lorem
Contexts in which element div may be used:
Where flow content is expected.
As a child of a dl element.
Content model for element span:
Phrasing content.
"""
0
Yes I also use https://validator.w3.org/ for html validations. This tool not show any errors. That's why I'm asking above question
0
Try this input
<a href="#" ><div>lorem</div></a>
🇮🇳Omkar🕉 //Busy , Exams.