运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #container { width: 60%; aspect-ratio: 3/2; border: solid black 1px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; place-items: start; } #container > div { width: 60%; aspect-ratio: 2; background-color: coral; } </style> </head> <body> <h1>The place-items Property</h1> <p>The value 'start' set for the place-items property is the same as setting 'start' to both the align-items and justify-items properties. This means that each grid item is placed within their grid cell at the start in the block direction and at the start in the inline direction.</p> <div id="container"> <div></div> <div></div> <div></div> <div></div> </div> </body> </html>