Elements height same as other element height while being wider and absolute positioned
Tag : html , By : Arun Thomas
Date : March 29 2020, 07:55 AM
may help you . Ok, i introduced id="parent" div and made this jsFiddle, then I added top:0, bottom:0 hack to #backgrounddiv to adjust the height to #parent div. I also changed the width in the example fiddle, so it can be seen working: <body>
<style>
body {
margin:0px;
background: yellow;
}
#parent{
position:relative;
}
#background {
background-color:black;
overflow: hidden;
position: absolute;
z-index: -1;
top:0;
bottom:0;
}
#background > div {
margin: auto;
width: 1108px;
height: 100%;
}
#content {
background: red;
width: 1004px;
margin: auto;
}
</style>
<div id="parent">
<div id="background">
<div><!-- this will not affect page scrolling if its width id greater than browsers window -->
</div>
</div>
<div id="content">
lorem ipsum dolor sit amet<br />
[...]
</div>
</div>
</body>
|
CSS: fit relative positioned parent to height of absolute positioned child
Tag : css , By : Daljit Dhadwal
Date : March 29 2020, 07:55 AM
hop of those help? Absolutely-positioned items are logically-associated with their parent, but not "physically". They're not part of the layout, so the parent item can't really see how big they are. You need to code the size yourself, or sniff it with JavaScript and set it at run-time.
|
Firefox not expanding absolute positioned div containing buttons
Date : March 29 2020, 07:55 AM
|
css div positioned absolute not expanding all the way to the bottom
Date : March 29 2020, 07:55 AM
around this issue What you want is position: fixed, not position: absolute. See this jsFiddle. Alternatively, why not just set the background-color of your ?
|
jquery change absolute positioned parent height to child height
Date : March 29 2020, 07:55 AM
I wish this help you I'm trying to figure out is there a way to get the height of the absolute positioned child and set it to parent with jQuery? For example the child has a hidden div and after clicking a radio button, the div will show and expand the height of the absolute positioned child. , You can get and set height using jQuery like this: <!-- html from the comment from the original question -->
<ol id="relative_one">
<li>
<div class="tabbed_title">
<div class="absolute_positioned child"></div>
</li>
</ol>
var $child = $('.child');
var $parent = $('.tabbed_title');
$("#radioButton").change(function () {
var childHeight = $child.height();
$parent.height(childHeight);
});
|