vitareinforce

contoh flexbox

Dec 8th, 2021 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. div.bagian-luar {
  6.   display: flex;
  7.   flex-wrap: nowrap;
  8.   background-color: DodgerBlue;
  9.   flex-direction: row;
  10. }
  11. div.bagian-luar > div.kiri {
  12.   width: 300px;
  13.   background-color: green;
  14.   text-align: center;
  15.   line-height: 75px;
  16.   font-size: 30px;
  17. }
  18. div.bagian-luar > div.tengah {
  19.   width: 400px;
  20.   background-color: red;
  21.   text-align: center;
  22.   line-height: 75px;
  23.   font-size: 30px;
  24. }
  25. div.bagian-luar > div.kanan {
  26.   width: 300px;
  27.   background-color: blue;
  28.   text-align: center;
  29.   line-height: 75px;
  30.   font-size: 30px;
  31. }
  32. </style>
  33. </head>
  34. <body>
  35. <h1>Flexible Boxes</h1>
  36.  
  37. <div class="bagian-luar">
  38.   <div class="kiri">1</div>
  39.   <div class="tengah">2</div>
  40.   <div class="kanan">3</div>
  41. </div>
  42.  
  43. <p>Try to resize the browser window.</p>
  44. <p>A container with "flex-wrap: nowrap;" will never wrap its items.</p>
  45. <p><strong>Note:</strong> Flexbox is not supported in Internet Explorer 10 or earlier versions.</p>
  46.  
  47. </body>
  48. </html>
  49.  
Add Comment
Please, Sign In to add comment