Is it possible to apply padding to a div without increasing its size?
<div id="someDiv">
someContent
</div>
#someDiv{
padding: 1em;
}
One potential solution is to add another nested div within #someDiv and apply margin to that, rather than padding. However, this may not be the most optimal solution.
Here's an example of how you could implement this:
<div id="someDiv">
<div idi="anotherDiv">
someContent
</div>
</div>
#anotherDiv{
margin: 1em;
}