Advertisement
here2share

HTML CSS box model

Aug 16th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. div {
  6.     background-color: lightgrey;
  7.     width: 300px;
  8.     border: 25px solid green;
  9.     padding: 25px;
  10.     margin: 25px;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15.  
  16. <h2>Demonstrating the Box Model</h2>
  17.  
  18. <p>The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.</p>
  19.  
  20. <div>This text is the actual content of the box. We have added a 25px padding, 25px margin and a 25px green border. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
  21.  
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement