Reputation: 2349
I want to make my web page flow better but I don't know what it's called that I am searching for!
Lets say I have the following HTML:
<section>
<article>
<h1>Article Header</h1>
<p>Article content</p>
</article>
<article>
<h1>Article Header</h1>
<p>Article content</p>
<p>More content</p>
</article>
<article>
<h1>Article Header</h1>
<p>Article content</p>
<p>More content</p>
<p>More content</p>
</article>
<article>
<h1>Article Header</h1>
<p>Article content</p>
<p>More content</p>
<p>More content</p>
<p>More content</p>
</article>
<article>
<h1>Article Header</h1>
<p>Article content</p>
<p>More content</p>
<p>More content</p>
</article>
<article>
<h1>Article Header</h1>
<p>Article content</p>
<p>More content</p>
</article>
and the following CSS
section article {
width: 49%;
display: inline-block;
}
That makes the articles appear side by side in the section, but there are gaps where the articles different sizes.
How would I make it flow so there were no gaps (ie fill the available space) ?
I am open to a solution using jQuery / JavaScript if needs be.
fiddle added:
Upvotes: 0
Views: 444
Reputation: 4560
I'm not sure I understand correctly what you want, but I think this is a duplicate of the following question:
How to Create Grid/Tile View with CSS?
Upvotes: 1
Reputation: 144689
section {
width: 100%;
}
article {
width: 50%;
display: inline-block;
margin: 0;
padding:0;
}
Upvotes: 0