Posted By

Masis on 10/19/10


Tagged

css margin


Versions (?)

Margin


 / Published in: CSS
 

URL: http://phpforms.net/tutorial/tutorial.html

It determines a space size from each border of an element. A space is the space from border of a current element to internal border of its parental element

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  5. <title>margin</title>
  6. <style type="text/css">
  7. BODY {
  8. margin: 0; /* Remove indents */
  9. }
  10. DIV.parent {
  11. margin: 20%; /* Margins around the element */
  12. background: #fd0; /* Background color */
  13. padding: 10px; /* Areas around the text */
  14. }
  15. DIV.child {
  16. border: 3px solid #666; /* Frame parameters */
  17. padding: 10px; /* Areas around the text */
  18. margin: 10px; /* Margins around */
  19. }
  20. </style>
  21. </head>
  22. <body>
  23.  
  24. <div class="parent">
  25. <div class="child">
  26. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh
  27. euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim
  28. ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl
  29. ut aliquip ex ea commodo consequat.
  30. </div>
  31. </div>
  32.  
  33. </body>
  34. </html>

Report this snippet  

You need to login to post a comment.