March 6, 2013

CSS child bigger than parent allowed?

Question by Programista

Quick question.

I know i can make child div bigger than parent, but is it allowed by w3c? Is it against some rules? Any performance problems?

Answer by albertxing

There are many cases where you would need an overflow in the parent div, with a larger child div: for example, a fixed-position content frame.

And there should be no performance impediment; it should be around the same as rendering the child div as a sibling of the parent.

Answer by Starx

W3C specifications does not limit you what kind of value you use for its attributes, except for few cases like:

  • Integer Id Attribute

So, to answer your question, Yes it is allowed.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!