a content inside div exceeding the fixed size which is decided by css.
<style>
#fixeddiv {
position: fixed;
margin: auto;
max-height: 300px;
max-width: 700px;
}
</style>
<div id="fixeddiv">
<div id="M775568ScriptRootC1273665"></div>
<script src="https://jsc.adskeeper.co.uk/c/r/creditkarma.gq.1253664.js" async>
</script>
</div>
The content inside fixeddiv should be fixed between 300px height and 700px width but it exceeding it and position of the content displaying outside of fixed size.
Edited: Child DIV contain responsive native ad and i am trying to fix the position with parent DIV because i do not make modification inside the ad copy due to advertising network policy.
The width property is used to fill a div remaining horizontal space using CSS. By setting the width to 100% it takes the whole width available of its parent. Example 1: This example use width property to fill the horizontal space. It set width to 100% to fill it completely.
To convert it to a fixed-width layout, simply add a fixed with to the #wrapper and set the margins to auto. Setting the margins to auto will cause the left and right margins to be equal no matter how wide the browser window is, which will cause your fixed-width layout to be positioned in the center of the browser.
<style>
#fixeddiv {
position: fixed;
margin: auto;
max-height: 300px;
max-width: 700px;
width:100%;
height:100%;
}
#someotherdiv {
height:100%;
}
</style>
<div id="fixeddiv">
<div id="someotherdiv"> contents </div>
</div>
#fixeddiv > div{
display: block;
max-width: 100%;
height: auto;
vertical-align: top;
}
It really depends on the content inside the fixed div. You can also add overflow:hidden
so the child content wont overflow the fixed div boundaries
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With