Relative units giving rise to unequal side margins : measurement « Style Basics « HTML / CSS

HTML / CSS
1. Background Attributes
2. Basic Attributes
3. Basic Tags
4. Box Model
5. CSS Attributes and Javascript Style Properties
6. CSS Controls
7. Form Attributes
8. Form Style
9. Form Tags
10. Frame Attributes
11. Frame Tags
12. HTML
13. IE Firefox
14. Images
15. Layout
16. Layout Attributes
17. Link Attributes
18. Link Tags
19. List Attributes
20. List Style
21. List Tags
22. Marquee Attributes
23. Meta Tags
24. Microsoft Attributes
25. Object Attributes
26. Object Tags
27. Reference
28. Style Basics
29. Styles Tags
30. Table Attributes
31. Table Style
32. Table Tags
33. Text
34. Text Attributes
35. Text Tags
36. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
HTML / CSS » Style Basics » measurement 
Relative units giving rise to unequal side margins
 

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Relative units giving rise to unequal side margins</title>
  <style type="text/css">
    
      font-size: 1em;
      margin: 0 0 0 2em;
    }
    h1 
      font-size: 1.5em;
      margin: 0 0 0 2em;
    }    
  </style>
</head>
<body>
  <div>
    <h1>A heading</h1>
    <p>Some body text</p>
  </div>
</body>
</html>

 
Related examples in the same category
1. Absolute Units
2. Relative Units
3. Testing 96 DPI Equals an Inch
4. This paragraph has a 200 pixel width and 10 pixels of padding
5. Different measures
6. em is relative to the font size
7. Relative size font-size: .75em
8. width: size an element by assigning pixels, ems, a percentage, or another fixed measurement to width.
9. Percentages are more flexible because they can scale to the viewport.
10. width:100% stretches an element to the width of its parent.
11. Units of Length and Percentage
12. Absolute vs. Relative Measurements
13. one inch tall
14. inch measurement
15. font-size with various measurements
16. This font is 24 pixels tall and this div is 3 ems tall
17. The body's border is 1em thick
18. font-size: 1in
19. inch vs pixel
20. percentage measurement width
21. A negative margin
22. This paragraph has a 1 pixel thick, solid black border around it.
23. Comparing em to Pixels
24. This font is 1.2 smaller than the default size, or pixels.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.