Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

การใช้งาน CSS grid-column-gap Property

ใช้คุณสมบัติ grid-column-gap เพื่อกำหนดช่องว่างระหว่างคอลัมน์ใน CSS Grid

ตัวอย่าง

<!DOCTYPE html> <html>    <head>       <style>          .container {             display: grid;             background-color: green;             grid-template-columns: auto auto;             padding: 20px;             grid-column-gap: 20px;          }         .ele {            background-color: orange;            border: 2px solid gray;            padding: 35px;            font-size: 30px;            text-align: center;         }       </style>    </head>    <body>       <h1>Game Board</h1>       <div class = "container">          <div class = "ele">1</div>          <div class = "ele">2</div>          <div class = "ele">3</div>          <div class = "ele">4</div>          <div class = "ele">5</div>          <div class = "ele">6</div>       </div>    </body> </html>