Aleksiev Aleksiev -4 years ago 104
CSS Question

How to expand child <div> with 100% of body width?

I have something like this:

<body>
<div style="width:700px; margin:0 auto;">
<div class="inner-div"></div>
</div>
</body>


Is there a way to expand child div with class "inner-div", to 100% of body width?

Answer Source

This makes inner-div stretch from left to right:

div.inner-div {
  position: absolute;
  left: 0;
  width: 100%;
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download