It's proving difficult for me to make a parent element inherit the width of its children. Here is the link to the jsfiddle http://jsfiddle.net/4mk3S/
Currently, I only have an outer div with
white-space: nowrap;
and child divs with
display: inline-block;
I want the outer div to automatically adjust its width based on the total width of its child elements. Any assistance would be greatly appreciated. Thank you!
Code :
<div class="outer">
<div class="inner"></div>
<div class="inner"></div>
<div class="inner"></div>
</div>
.outer {
white-space: nowrap;
padding: 10px;
background: green;
}
.inner {
display: inline-block;
width: 1000px;
height: 100px;
background: red;
}