box-sizing-4-ref.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html lang="en-US">
  3. <head>
  4. <title>test of box-sizing</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta http-equiv="Content-Style-Type" content="text/css">
  7. <style type="text/css">
  8. body { font-size: 10px; line-height: 1; }
  9. table { border-spacing: 0; margin: 0 100px; }
  10. td { border: 1px solid; padding: 1px solid; }
  11. td > div { width: 100px; }
  12. td > div > div {
  13. margin-left: 1px;
  14. border-left: 2px solid;
  15. padding-left: 4px;
  16. padding-right: 8px;
  17. border-right: 16px solid;
  18. margin-right: 32px;
  19. background: yellow;
  20. margin-bottom: 10px;
  21. float: right;
  22. clear: right;
  23. text-align: right;
  24. height: 40px;
  25. right: 0;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <table><tr>
  31. <td id="bscontent"><div>
  32. <!-- box-sizing: content-box -->
  33. <div>A B</div>
  34. <div>A B</div>
  35. <div>A<br>B</div>
  36. <div>A B</div>
  37. <div style="width: 37px">A B</div>
  38. <div style="width: 50px">A B</div>
  39. <div style="width: 60px">A B</div>
  40. </div></td>
  41. <td id="bsborder"><div>
  42. <!-- box-sizing: border-box -->
  43. <div>A B</div>
  44. <div>A B</div>
  45. <div>A<br>B</div>
  46. <div>A B</div>
  47. <div style="width: 37px">A B</div>
  48. <div style="width: 20px">A B</div>
  49. <div style="width: 30px">A B</div>
  50. </div></td>
  51. </tr></table>
  52. </body>
  53. </html>