b0673faf5495a486b4c006166ac30e9a00dc9c31.svn-base 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html>
  4. <head>
  5. <title>Stacking and float</title>
  6. <!-- https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/Stacking_and_float?redirectlocale=en-US&redirectslug=CSS%2FUnderstanding_z-index%2FStacking_and_float -->
  7. <script type="text/javascript" src="../../test.js"></script>
  8. <style type="text/css">
  9. div {
  10. font: 12px Arial;
  11. }
  12. span.bold { font-weight: bold; }
  13. #absdiv1 {
  14. opacity: 0.7;
  15. position: absolute;
  16. width: 150px;
  17. height: 200px;
  18. top: 10px;
  19. right: 140px;
  20. border: 1px solid #990000;
  21. background-color: #ffdddd;
  22. text-align: center;
  23. }
  24. #normdiv {
  25. /*opacity: 0.7;*/
  26. height: 100px;
  27. border: 1px solid #999966;
  28. background-color: #ffffcc;
  29. margin: 0px 10px 0px 10px;
  30. text-align: left;
  31. }
  32. #flodiv1 {
  33. opacity: 0.7;
  34. margin: 0px 10px 0px 20px;
  35. float: left;
  36. width: 150px;
  37. height: 200px;
  38. border: 1px solid #009900;
  39. background-color: #ccffcc;
  40. text-align: center;
  41. }
  42. #flodiv2 {
  43. opacity: 0.7;
  44. margin: 0px 20px 0px 10px;
  45. float: right;
  46. width: 150px;
  47. height: 200px;
  48. border: 1px solid #009900;
  49. background-color: #ccffcc;
  50. text-align: center;
  51. }
  52. #absdiv2 {
  53. opacity: 0.7;
  54. position: absolute;
  55. width: 150px;
  56. height: 100px;
  57. top: 130px;
  58. left: 100px;
  59. border: 1px solid #990000;
  60. background-color: #ffdddd;
  61. text-align: center;
  62. }
  63. </style></head>
  64. <body>
  65. <br /><br />
  66. <div id="absdiv1">
  67. <br /><span class="bold">DIV #1</span>
  68. <br />position: absolute;
  69. </div>
  70. <div id="flodiv1">
  71. <br /><span class="bold">DIV #2</span>
  72. <br />float: left;
  73. </div>
  74. <div id="flodiv2">
  75. <br /><span class="bold">DIV #3</span>
  76. <br />float: right;
  77. </div>
  78. <br />
  79. <div id="normdiv">
  80. <br /><span class="bold">DIV #4</span>
  81. <br />no positioning
  82. </div>
  83. <div id="absdiv2">
  84. <br /><span class="bold">DIV #5</span>
  85. <br />position: absolute;
  86. </div>
  87. </body></html>