<!DOCTYPE html> <!-- Box Model: examples of applying padding and margin --> <html> <head> <meta charset = "utf-8"> <title>Box Model</title> <style type = "text/css"> div { width: 50%; border-width: 3px; border-style: solid; font-size: 20pt; } .padding { padding: 1em; } .margin { margin: 1em; } .other { padding-left: .5em; padding-top: 2em; margin-top: 2em; } </style> </head> <body> <div> This is a div with some text </div> <div> This is a div with some more text </div> <div class="margin"> This is a div with margin </div> <div class="margin"> This is another div with margin (margin is not additive) </div> <div class="padding"> This is a div with padding </div> <div class="padding"> Another with padding </div> <!-- Note: only one class attribute! --> <div class="margin padding"> This one has both margin and padding </div> <div class="other"> Some specific settings </div> </body> </html>