Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

html-align-to-css.html 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>HTML align attribute to CSS - HTML Purifier Specimen</title>
  6. <style type="text/css">
  7. div.container {position:relative;height:110px;}
  8. div.container.legend .test {text-align:center;line-height:100px;}
  9. div.test {width:100px;height:100px;border:1px solid black;
  10. position:absolute;top:10px;}
  11. div.test.html {left:10px;}
  12. div.test.css {left:140px;}
  13. table {background:#F00;}
  14. img {border:1px solid #000;}
  15. hr {width:50px;}
  16. div.segment {width:250px; float:left; margin-top:1em;}
  17. </style>
  18. </head>
  19. <body>
  20. <h1>HTML align attribute to CSS</h1>
  21. <p>Inspect source for methodology.</p>
  22. <div class="container legend">
  23. <div class="test html">
  24. HTML
  25. </div>
  26. <div class="test css">
  27. CSS
  28. </div>
  29. </div>
  30. <div class="segment">
  31. <h2>table.align</h2>
  32. <h3>left</h3>
  33. <div class="container">
  34. <div class="test html">
  35. a<table align="left"><tr><td>O</td></tr></table>a
  36. </div>
  37. <div class="test css">
  38. a<table style="float:left;"><tr><td>O</td></tr></table>a
  39. </div>
  40. </div>
  41. <h3>center</h3>
  42. <div class="container">
  43. <div class="test html">
  44. a<table align="center"><tr><td>O</td></tr></table>a
  45. </div>
  46. <div class="test css">
  47. a<table style="margin-left:auto; margin-right:auto;"><tr><td>O</td></tr></table>a
  48. </div>
  49. </div>
  50. <h3>right</h3>
  51. <div class="container">
  52. <div class="test html">
  53. a<table align="right"><tr><td>O</td></tr></table>a
  54. </div>
  55. <div class="test css">
  56. a<table style="float:right;"><tr><td>O</td></tr></table>a
  57. </div>
  58. </div>
  59. </div>
  60. <!-- ################################################################## -->
  61. <div class="segment">
  62. <h2>img.align</h2>
  63. <h3>left</h3>
  64. <div class="container">
  65. <div class="test html">
  66. a<img src="img.png" align="left">a
  67. </div>
  68. <div class="test css">
  69. a<img src="img.png" style="float:left;">a
  70. </div>
  71. </div>
  72. <h3>right</h3>
  73. <div class="container">
  74. <div class="test html">
  75. a<img src="img.png" align="right">a
  76. </div>
  77. <div class="test css">
  78. a<img src="img.png" style="float:right;">a
  79. </div>
  80. </div>
  81. <h3>bottom</h3>
  82. <div class="container">
  83. <div class="test html">
  84. a<img src="img.png" align="bottom">a
  85. </div>
  86. <div class="test css">
  87. a<img src="img.png" style="vertical-align:baseline;">a
  88. </div>
  89. </div>
  90. <h3>middle</h3>
  91. <div class="container">
  92. <div class="test html">
  93. a<img src="img.png" align="middle">a
  94. </div>
  95. <div class="test css">
  96. a<img src="img.png" style="vertical-align:middle;">a
  97. </div>
  98. </div>
  99. <h3>top</h3>
  100. <div class="container">
  101. <div class="test html">
  102. a<img src="img.png" align="top">a
  103. </div>
  104. <div class="test css">
  105. a<img src="img.png" style="vertical-align:top;">a
  106. </div>
  107. </div>
  108. </div>
  109. <!-- ################################################################## -->
  110. <div class="segment">
  111. <h2>hr.align</h2>
  112. <h3>left</h3>
  113. <div class="container">
  114. <div class="test html">
  115. <hr align="left" />
  116. </div>
  117. <div class="test css">
  118. <hr style="margin-right:auto; margin-left:0; text-align:left;" />
  119. </div>
  120. </div>
  121. <h3>center</h3>
  122. <div class="container">
  123. <div class="test html">
  124. <hr align="center" />
  125. </div>
  126. <div class="test css">
  127. <hr style="margin-right:auto; margin-left:auto; text-align:center;" />
  128. </div>
  129. </div>
  130. <h3>right</h3>
  131. <div class="container">
  132. <div class="test html">
  133. <hr align="right" />
  134. </div>
  135. <div class="test css">
  136. <hr style="margin-right:0; margin-left:auto; text-align:right;" />
  137. </div>
  138. </div>
  139. </div>
  140. </body>
  141. </html>