运行 ❯
获取您的
自己
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> #flex-container { border: 1px solid black; background-color: rgb(255, 230, 251); display: flex; flex-wrap: wrap; gap: 20px 70px; } #flex-container > div { border: 1px solid black; width: 10%; aspect-ratio: 2; padding: 10px; background-color: lightgreen; } </style> </head> <body> <h1>The gap Property with flexbox</h1> <p>Use the <em>gap</em> property to specify the size of the gap between the rows and the columns in a flexbox layout.</p> <p>This flexbox layout has a 20px gap between the rows, and a 70px gap between the columns:</p> <div id="flex-container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> <div>11</div> <div>12</div> <div>13</div> </div> </body> </html>