<div class="grid grid-cols-3 gap-2">
<div class="children-1 col-span-1 p-4 border rounded-md flex justify-center items-center bg-red-600 text-white">Hello</div>
<div class="children-2 col-span-1 p-0 border rounded-md flex justify-center items-center">world</div>
<div class="children-3 col-span-1 p-0 border rounded-md flex justify-center items-center">again</div>
</div>
In this provided code, why do children-2 and children-3 inherit the ‘p-4’ class from children-1 but not the ‘bg-red-600’ and ‘text-white’ classes from children-1? What I actually want is different padding for these three siblings.
New contributor
Neerazan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.