Quite a "simple" problem here and not sure why it's being so complicated.
- Have a 100% (width) sized div.
- Have another div positioned in the middle of this div (sized 940px width)
Any ideas? :)
Quite a "simple" problem here and not sure why it's being so complicated.
Any ideas? :)
Doesn't work in internet explorer 7... but who cares ?
for detail info, let's say the code below will make a div aligned center:
or simply use:
but bear in mind, the above CSS code only works when you specify a fixed width (not 100%) on your html element. so the complete solution for your issue would be:
The below style to the inner div will center it.
Just add
margin: 0 auto;
to the inside div.The key is the margin: 0 auto; on the inner div. A proof-of-concept example: