Having a question that I couldn't find an answer to on Google...
I am looking to eliminate the gap between DIVs in my small PHP application. The DIVs display user images and other information, with a width of 250px and height set to auto since the content length varies. As the number of DIVs is fetched from MYSQL, I am unsure about the exact count.
Check out a screenshot of my webpage: https://i.sstatic.net/r8P5Y.jpg
Here is the code snippet:
<style>
#det
{
width:250;
height:auto;
max-height:400px;
border-bottom:3px solid darkred;
background-color:white;
float:left;
padding:0px;
margin:0 auto;
border-radius:5px;
}
HTML
<div id='det'>
<img src='$user_image'><p>some text</p>
</div>
I want to remove the gap between DIVs to achieve a magazine-style layout similar to masonry.desandro.com. Although I have used float:left
, it's not functioning correctly, possibly due to the unset height property. Is there a solution to this issue without specifying the div height?
Thank you