Will there be a valid code where the child block is wider and taller than the parent?

<div style="position: absolute; width: 1px; height: 1px; top: 100px; left: 100px;"> <div style="position: absolute; width: 100px; height: 100px; top: -50px; left: -50px;"></div> </div> 
  • one
    Valid according to what? What standards are you talking about now? - VenZell
  • Insert here and check :). Or what did you want? - Sasha Chernykh

1 answer 1

According to the official W3C validator, this code will be valid:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <div style="position: absolute; width: 1px; height: 1px; top: 100px; left: 100px;"> <div style="position: absolute; width: 100px; height: 100px; top: -50px; left: -50px;"></div> </div> </body> </html> 

Document checking completed. No errors or warnings to show.