<!DOCTYPE html> <html> <head> <style type="text/css"> body { margin: 0; padding: 10px 0; } #block { background-color: green; padding: 10px 0; } #inline-block { display: inline-block; background-color: lightgreen; } </style> </head> <body> <div id="block"><div id="inline-block">Hello Kitty</div></div> </body> </html>