Wolfbeast

Float on details bug workaround

Nov 25th, 2017
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.12 KB | None | 0 0
  1. <html>
  2.   <style>
  3.   body {
  4.     width: 400px;
  5.   }
  6.   div#float {
  7.     float: left;
  8.     width: 200px;
  9.     height: 200px;
  10.     background-color: lightgreen;
  11.   }
  12.   details {
  13.     /* float: left; */
  14.     background-color: orange;
  15.   }
  16.   summary {
  17.     background-color: green;
  18.     /* Hide the triangle for comparing with div in reftest. */
  19.     list-style-type: none;
  20.   }
  21.   </style>
  22.   <body>
  23.     <!-- This tall float block is necessary to reproduce the incorrect height of the details. -->
  24.     <div id="float"></div>
  25.     <div style="float:left">
  26.     <details>
  27.       <summary>Summary</summary>
  28.       Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
  29.       tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
  30.       veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
  31.       commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
  32.       velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
  33.       cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
  34.       est laborum.
  35.     </details>
  36.     </div>
  37.   </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment