What happens when a block element is placed inside an inline element, according to HTML5 specifications?

  • Both elements are disregarded by the browser. 
  • The block element is converted to an inline element. 
  • The outer inline element becomes a block element. 
  • The page will throw an error. 
In the HTML5 specification, it's not considered valid to place a block-level element inside an inline element. If this happens, browsers will often automatically adjust the rendering so that the inline element containing the block is treated as a block-level element. However, this behavior may vary across browsers. It's best practice to avoid such nesting to ensure consistent rendering. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *