CSS to create overlapping profile images

I want to turn a horizontal list of tiles into an overlapping list of tiles like you see in most social media apps. If you can figure this out using CSS, I’d be happy to compensate your time.

Turn this…

…into this (+2 not necessary):

image

2 Likes

Nevermind…figured it out :grin:

Screen Shot 2021-04-19 at 9.32.17 PM

<pre><span><style>
.tile-inner {
width: 80px;
}
.inner {
grid-template-columns: repeat(5, 40px) !important;
}
6 Likes

Just gotta add the border now.

3 Likes

Thanks for sharing, this is great!

1 Like
.tile-inner {
width: 87px;
}

.tile-image-area {
border: solid 5px white;
border-radius: 50%;
box-shadow: inset 0px 0px 0px 10px white;
}

.inner {
grid-template-columns: repeat(5, 55px) !important;
}

Screen Shot 2021-04-19 at 9.57.49 PM

14 Likes

I hope you compensated yourself handsomely :joy:

4 Likes

Great job. It looks really nice too!

Neat :wink:

Oh wow, simply gorgeous!

A doubt arose, you said you were planning to update your app in glide template store, but once we cannot use any code inside of it, can we when it’s an update?

Hm. Good pt. Glide doesn’t want templates with CSS because it’s confusing to new Glide users. Maybe if it’s well documented in your template instructions and it doesn’t impact the functionality or significantly alter the layout of the app…

Thanks! I should mention that we should use the horizontal, circular tile layout, 4 tiles wide to get the same effect.

has something changed?
The border works perfectly, but the overlapping is not working anymore.
Can you please help?

Hi, @Robert_Petitto ! :blush:

When I saw this, I was very surprised to see how CSS can be used to create such a function.

At the same time, I thought…

I was wondering if it’s possible to make the white border a gradient like in the picture? If so, can you teach me how to do that? :blush:

Hola @Anna-1

<pre><span><style>
.tile-inner {
width: 80px;
}

.tile-image-area {
border: solid 5px red;
border-radius: 50%;
box-shadow: inset 0px 0px 0px 10px red;
}

.inner {
grid-template-columns: repeat(5, 55px) !important;
}

have you tried changing the color from white to whatever color you need?

Screen Shot 2021-06-30 at 1.08.29 PM

2 Likes

Hola @Harsh
I believe you need to set the orientation of your inline list, tile layout to Horizontal.

I may be wrong.

3 Likes

Correct. Layout needs to be horizontal for it to work. You can set the border radius to whatever you’d like. You can even use the color ‘transparent’ so that way it works well with both light and dark theme.

3 Likes

Thank you @SantiagoPerez @Robert_Petitto !

I was able to add some color too.

スクリーンショット 2021-07-01 17.36.34

But I can’t get the gradient border like in the Instagram stories :sweat:
Is there any way to make this border a gradient?

1 Like

I don’t have the right hex codes for the border here, it seems like this code is old and I can’t derive it from the site itself but you can use some trial and errors to figure out all the colors.

<pre><span><style>

.tile-inner {
padding: 5px 0px;
}

.tile-image-area {
border-radius: 50%;
box-shadow: inset 0px 0px 0px 10px white;
}

.tile-image-area:before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -4px; 
    border-radius: inherit;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
}
5 Likes

Thank you @ThinhDinh :blush:

That was so awesome, I’m so impressed :joy:
It’s exactly what I’ve been wanting. Thank you so much!!

2 Likes