Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Collapse over an element

I'm using Bootstrap 3 to make a responsive website. However, I'm making a "portfolio".

You can see the website here as well as my "error".

http://basic-models.com/b/

Scroll down to "Our models" and click on "Informations". When you click on that button, it will collapse a new element below the profile picture of a model.

But that collapsible element is pushing the picture below the element to right for one column.

I guess I don't have to place code here since you can just right click > source code it.

Also, this is my first question on Stack Overflow, so I'm sorry if it is not formatted properly. Thank you for all the help.

like image 974
The GTMD Avatar asked Nov 22 '25 02:11

The GTMD


2 Answers

You can change the CSS position attribute of the collapsing div to absolute. That way, the element will float over the below item - but you`ll have to apply styles a bit.

Try it like that:

.model-outer div.collapse {
    position: absolute; 
    z-index: 1000; 
    background-color: white; 
    width:100%;
    left:0px;
    margin-top:10px;
}

You see, positioning and styles are not that good, but I assume you can start from there.

like image 90
dhh Avatar answered Nov 23 '25 16:11

dhh


Since you are already using Bootstrap, I would suggest you to use default bootstrap dropdown . The problem with current code is that the div which shows the information is not absolutely positioned. So, whenever that div is displayed, it takes up the extra space and breaks the layout of the grid. Bootstrap dropdown uses absolute positioned div and hence it doesn't break the layout. Try using it and it will definitely solve this issue.

like image 27
K K Avatar answered Nov 23 '25 14:11

K K