| <!DOCTYPE html> |
| <!-- |
| | Anonymous block boxes are ignored when resolving percentage values |
| | that would refer to it: the closest non-anonymous ancestor box is used |
| | instead. |
| | https://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level |
| --> |
| <html> |
| <head> |
| <style> |
| .outer { |
| background-color: #2196f3; |
| height: 200px; |
| width: 200px; |
| } |
| .inner { |
| background-color: #3f51b5; |
| display: inline-block; |
| height: 50%; |
| width: 50%; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="outer"> |
| <span class="inner"></span> |
| <div></div> |
| </div> |
| </body> |
| </html> |