Grid template area issue
Hi, I am using Grid template area, I want the Accessories part to take the area below it, how to do it?
Check the code: https://codepen.io/hamzacodepen951/pen/poqdyXN
![No description](https://cdn.answeroverflow.com/1153603169578930236/Screenshot_2023-09-19_130342.png)
15 Replies
your background-image has to be on that grid child not on a child of that child 😉
you can also give that child a height of 100% but then you need to add the missing the box-sizing reset https://codepen.io/MannixMD/pen/MWZOeJE
adding height 100% to .category-img fixed the issue, thanks
Also one more thing, how could I zoom in and show the specific part of image, like for earring category, I want to show earring of model, and for necklace category, I want to show necklace of model, is that possible? if yes, then how to do it?
![No description](https://cdn.answeroverflow.com/1153610705602355201/Screenshot_2023-09-19_130342.png)
scale or background-size
and background-position probably
Ok, thanks 😀
Hi again Mannix, I did this tomorrow, by adding height and box sizing border box, and it worked, and now I just realize that the ACCESSORIES text is not centered, how to do it?
text is still centered with the above box
![No description](https://cdn.answeroverflow.com/1153929119889887263/Screenshot_2023-09-20_104157.png)
![No description](https://cdn.answeroverflow.com/1153932285117202513/Screenshot_2023-09-20_105422.png)
use grid or flexbox or position it's up to you i don't know why you used padding originally
padding for text?
in your pen you have
padding: 7em 0;
I used padding for the cards to give height
and that pushed the text to center originally
ok, now I got your point, so what is the good practice then?
add
where you put height: 100%;