Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Snapping images of a different height into a grid

Featured Replies

Find this in the CSS:

.mosaicflow__item {
	padding:5px;
}

Replace it with this:

.mosaicflow__item {
	padding:0px;
}

Tried and tested.

Not sure I understand correctly

 

try changing the height on the code below to 400px see if thats what you want

 

.mosaicflow__item img {
display: block;
width: 100%;
height: auto;/*change this to the height you want the images*/
}

 

Not sure I understand correctly

 

try changing the height on the code below to 400px see if thats what you want

 

.mosaicflow__item img {
display: block;
width: 100%;
height: auto;/*change this to the height you want the images*/
}

 

That causes the elements to blow up in size. Also, as I said in my first post, it's a padding issue and I provided the tried-and-tested fix. :)

well you read his problem differently to me

 

so I shall bow down to your superior knowledge

 

I'm certain he's referring to the white margins in-between all the images, which is caused by padding, and when I removed the padding on Chrome CSS editor it snapped them all together. No superiority or anything. :)

Thats the problem with reading things online were not really sure what the op is after

 

I read it as though he wants them to line up hence I said to try and see if thats what he wants. sorry for being a grouch :drinks:

 

Untitled-1.jpg

 

 

Thats the problem with reading things online were not really sure what the op is after

 

I read it as though he wants them to line up hence I said to try and see if thats what he wants. sorry for being a grouch :drinks:

 

You could be right, we won't know until he replies, let's see. :p

i read it as mteam pointed out maby have something like :nth-child(even) to have different tile heights

 

you could use something like

<style>
	.holder {
		width:630px;
		height:600px;
	}
	
	.test {
		background:#00f;
		width:200px;
		margin:5px;
		height:400px;
        display: block;
		vertical-align: top;
		background-size:cover;
	}
	
	.col:nth-child(even) .test:nth-child(even) {
		height:200px;
	}
	
	.col:nth-child(odd) .test:nth-child(odd) {
		height:200px;
	}
	
	.col {
		width:200px;
		display:inline-block;
	}
</style>

<div class="holder">
<div class="">
	<div class="col">
		<div class="test" style="background-image:url('link/to/image.png');"></div>
		<div class="test" style="background-image:url('link/to/image.png');"></div>
	</div>
	<div class="col">
		<div class="test" style="background-image:url('link/to/image.png');"></div>
		<div class="test" style="background-image:url('link/to/image.png');"></div>
	</div>
	<div class="col">
		<div class="test" style="background-image:url('link/to/image.png');"></div>
		<div class="test" style="background-image:url('link/to/image.png');"></div>
	</div>
</div>

Edited by D4Y0

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.