Grid - defining elements
Hi, I'm a beginner and I have a really trivial question. Is there any way to avoid writing p elements 17 times, but define them by grid?
7 Replies
Here's the code
You could use JavaScript to render the elements but itβs gonna take a lot longer to do so then writing <p> tags if thatβs your concern
You can also use grid areas with blank naming
.
oh but you need elements inside to do the boxes I didn't see your
p
styles
If you are not going to actually have text inside a p
either just use a <div>
Another option is to use a HTML template language.Grid still needs children. Text nodes don't count as separate children. Learn Emmet to generate the tags. https://docs.emmet.io/cheat-sheet/
Generating 17 paragraph tags with Emmet is as simple as:
Thank you all for your responses!