Advertisement
PayneLess_Designs

PayneLess Designs - Text - Aligned Left, Right and Center

Jul 11th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.41 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html><head>
  3. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  4. <title>Text - Aligned Left, Right and Center</title>
  5. <meta name="description" content="">
  6. <meta name="keywords" content="">
  7. <meta name="copyright" content="PayneLess Designs">
  8. <meta name="author" content="Ron">
  9. <style type="text/css">
  10. * { margin: 0; padding: 0; border: 0; }
  11.  
  12. h1 { text-align: center; }
  13.  
  14. #example_one {
  15. width: 800px;
  16. height: 200px;
  17. margin: 2% auto;
  18. padding: 10px;
  19. border: 1px solid #f00;
  20. }
  21.  
  22. span.left { display: block; float: left; }
  23. span.right { display: block; float: right; }
  24.  
  25. #example_two {
  26. width: 800px;
  27. margin: 2% auto;
  28. height: 200px;
  29. margin: 2% auto;
  30. padding: 10px;
  31. border: 1px solid #0f0;
  32. }
  33.  
  34. p.left { float: left; }
  35. p.right { float: right; }
  36. p.center { text-align: center; }
  37.  
  38. p { font-size: 1em; }
  39. </style>
  40. <!--[if IE: >
  41. <link rel="stylesheet" type="text/css" href="css_styles_ie.css">
  42. <![endif: -->
  43. </head><body>
  44. <h1>Text - Aligned Left, Right and Center</h1>
  45. <div id="example_one">
  46. <p><span class="left">This text is aligned left</span> <span class="right">while this text is aligned right!</span></p>
  47. </div>
  48.  
  49. <div id="example_two">
  50. <p class="left">This text is aligned left.</p><p class="right">This text is aligned right!</p>
  51. <p class="center">This text is centered.</p>
  52. </div>
  53. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement