The child doesn't actually inherit background-color. The child's background is transparent. You're seeing a red background because it's sitting on top of something red, but that means nothing to the child; if you position it so it's outside of its parent, it won't have a red background.
What it sounds like you're actually asking for is for the child element to cut a hole in the parent's background so that the element behind it shows through. Is that right?
If that's what you're after, then no, you can't do this.
The closest you can get to it is the clip
CSS property.
You would define clip
on the parent's CSS as a rectangle which covers the same space as the child element. (of course, you'd have to know in advance the dimensions of the child to be able to do this)
This would be a way to achieve what you're after, but clip
does have some major limitations, not least of which is that it only works if the element is position:absolute
or position:fixed
.
You can read more about clip
here: http://tympanus.net/codrops/2013/01/16/understanding-the-css-clip-property/
Another alternative might be to use SVG instead of HTML for this. It's easier to achieve this kind of effect using SVG, since it is a proper graphics language.