<div name="outer" style='background-color:red; '>
<div name="inner"style='background-color:yellow; width:200px'>
some content
</div>
<div style="clear: both"></div>
</div>
please take look any one my jsfiddle?
Add
display: inline-block;
to your outer div, which will set the width and height of inner div to the outer div.
UPDATE
Add this CSS to your outer div. ie to #LandingDiv
display: flex;
align-items: center;
background-color: transparent;
Then add
background-color: white;
to inner div. ie #LandingContent
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.