Skip to content Skip to sidebar Skip to footer

Setting Height Of Surrounding Div After Inner Div Is Expanded/collapsed

I have a simple accordion. What i am trying to do is that when an item within the content is clicked (How to reach us) for example, the hidden subsequent text is expanded. Once exp

Solution 1:

If I understand your issue correctly, then this may help:

Demo Fiddle

Your content div doesn't have a specified width, so it's automatically wrapping whatever is inside of it, when you show your text it extends out further than it was initially.

EDIT - I think that there may be an easier way to go about what you're trying to accomplish. Instead of using JS to dynamically update the .wrapper I think it would be easier to remove the position: absolute from .content. Some padding seemed to make it look the same.

CSS:

.content {
    width: 280px;
    background: #99CCFF;
    padding: 10px0;

    //position:absolute;
}

Post a Comment for "Setting Height Of Surrounding Div After Inner Div Is Expanded/collapsed"