DEV Community 👩‍💻👨‍💻

Discussion on: CSSBattle Target#2

Collapse
prakhart111 profile image
Prakhar Tandon Author

Yeah sure, we can also do the same with CSS grids.
Here's the code:

<div id="cont"><p id="i1"><p id="i2"><p id="i3"><p id="i4">
<style>
*{background:#62374e;margin:0}
#cont{
display:grid;
grid-template-columns:repeat(9,50px);
grid-template-rows:repeat(7,50px)
}
p{background:#fdc57b}
#i1{grid-area:2/2/3/3}
#i2{grid-area:2/7/3/8}
#i3{grid-area:5/2/6/3}
#i4{grid-area:5/7/6/8}
Enter fullscreen mode Exit fullscreen mode

Cheers Sam!