Can this be easily the made with html and css

Hello I found this image of a nice card that I can use for a project Now I wonder if this can be easily be made with html and css
No description
68 Replies
b1mind
b1mindβ€’2w ago
:yes:
roelof
roelofOPβ€’2w ago
very fast answer I think a a background-color with a image on it which has the ligther color or maybe use :after to make the lighter circle
b1mind
b1mindβ€’2w ago
just layer with grid then you can have better* options for mobile
roelof
roelofOPβ€’2w ago
Why use grid ? I think flex can do easily the job
b1mind
b1mindβ€’2w ago
I think grid is 100% better for this you can't layer with flex for one πŸ₯²
roelof
roelofOPβ€’2w ago
I think you can layer. For FEM challenges I make a layer for the background and one for a image
b1mind
b1mindβ€’2w ago
I'm sure then you used pos absolute not flex don't fear the grid
roelof
roelofOPβ€’2w ago
I do not fear grid at all Thanks for the help
b1mind
b1mindβ€’2w ago
just a quick mock to mental around how I might do it but ya I'm reaching for grid.
No description
roelof
roelofOPβ€’2w ago
oke, I still do not see how grid can help me here I do not find it a block layout
b1mind
b1mindβ€’2w ago
idk what that means sorry I think of display: block when you say that πŸ₯²
roelof
roelofOPβ€’2w ago
oke
b1mind
b1mindβ€’2w ago
This is grid
13eck
13eckβ€’2w ago
Here's a really hacky way of doing it: https://codepen.io/13eck/pen/dPPYPOr Sorry, b1, no grid >_<
b1mind
b1mindβ€’2w ago
No description
b1mind
b1mindβ€’2w ago
Seriously no reason to use flex even in your example
13eck
13eckβ€’2w ago
πŸ˜’
No description
13eck
13eckβ€’2w ago
Grid throws in more space between the elements Then again:
.card {
border-radius: 100%;
font-size: 0.875em;
max-width: 40ch;
aspect-ratio: 1;
padding-inline: 1em;
padding-block: 0.5em;
background-color: tan;
}

.card > * {
margin-inline: 2em;
}

.card > * + * {
margin-block-start: 1em;
}
.card {
border-radius: 100%;
font-size: 0.875em;
max-width: 40ch;
aspect-ratio: 1;
padding-inline: 1em;
padding-block: 0.5em;
background-color: tan;
}

.card > * {
margin-inline: 2em;
}

.card > * + * {
margin-block-start: 1em;
}
No flex or grid needed :p
b1mind
b1mindβ€’2w ago
yea honestly any time I see flex-direction: col just for a stack should have been block or grid 90% of the time πŸ₯² Also just pointing out your solutions not really on point to the design πŸ˜‰ I was in a match trying to look but its a far cry from it xD Aslo to be fair its kinda hard to see what is the "card" and what is cut off in the screenshot :think:
13eck
13eckβ€’2w ago
Eh, it's a starting point. It has what I think are the key visuals: * circular, offset image * Circular background * Testimonial header * Testimonial text * Testimonial author
b1mind
b1mindβ€’2w ago
what about top right studio "brand" tag stars xD I mean layout is layout and how you want things to line up and behave when squished matter
13eck
13eckβ€’2w ago
Honestly didn't even see the brand tag. Bad contrast
b1mind
b1mindβ€’2w ago
You can see clear aligment based on these things too
13eck
13eckβ€’2w ago
You know my eyes are bad >_>
b1mind
b1mindβ€’2w ago
yea the contrast for color blind folks is terrible (which I forget you are sometimes mbmb) I'd say all the colors need a proper checking xD AA maybe...
b1mind
b1mindβ€’2w ago
this is how my mind sees it
No description
b1mind
b1mindβ€’2w ago
ultimate control too xD
roelof
roelofOPβ€’2w ago
Thanks now i see why you want to use grid
b1mind
b1mindβ€’2w ago
yea I didn't want to link the pen directly but if you want let me know and I will give it a try first πŸ˜„ (also hint I'm using Grid-areas)
13eck
13eckβ€’2w ago
That's a lot of grid areas! O_O
roelof
roelofOPβ€’2w ago
Of course
b1mind
b1mindβ€’2w ago
named too πŸ˜‰ so ez pz
roelof
roelofOPβ€’2w ago
Yep im thinking now also about grid areas
13eck
13eckβ€’2w ago
Ok, so now I really wanna see that pen So many things to learn about Grid
roelof
roelofOPβ€’2w ago
The only thing i do not see then is hoe to make the Light Brown circle But nowcreaaly time to sleep Now really time to sleep Stupid text correction on a mobile phone
13eck
13eckβ€’2w ago
Then stop correcting the text correction and sleep, my dude :p
RΓ€gnar O'ock
RΓ€gnar O'ockβ€’2w ago
One per thing you have to place, don't mistake grid areas and grid cells Lookup conic gradient backgrounds But the gradient might just be a drop shadow on the image
b1mind
b1mindβ€’2w ago
ya I should have shared this view but I didn't want to get it twisted lol
No description
b1mind
b1mindβ€’2w ago
I wish edge did line labels better but I typically have those on too and it gets a bit wild xD
vince
vinceβ€’2w ago
Man this is not easy πŸ˜‚ Did you psuedo element the circle?
vince
vinceβ€’2w ago
here's my attempt
No description
vince
vinceβ€’2w ago
(I was too lazy to include the stars and brand, this already took me like 45 min lmao)
13eck
13eckβ€’2w ago
Good design takes time :p
vince
vinceβ€’2w ago
definitely a bit off Beck's or b1s are probably written way better but i can give codepen too if you get stuck or want a reference @roelof
13eck
13eckβ€’2w ago
Does yours have a dropshadow, vince? On the image
vince
vinceβ€’2w ago
Ye!
13eck
13eckβ€’2w ago
That already makes it better than mine lol
vince
vinceβ€’2w ago
I think theirs has a really slight box shadow xD
13eck
13eckβ€’2w ago
Slight box shadows disappear for me. Bad contrast for my eyes
vince
vinceβ€’2w ago
I never would have thought about that actually that's really good to know
13eck
13eckβ€’2w ago
see also ☝️ I'm partially colourblind so I have a problem seeing poor contrast
vince
vinceβ€’2w ago
Yea especially with the gradient they have on the white circle too, makes the whole contrast of the card just way worse I actually thought the markup was really tough too I don't think my markup is the best, I included eveything in an article > figure then added a blockquote inside the figure & then added a figcaption with a cite for the person I don't think that's the best solution at all but one I came up with lol
vince
vinceβ€’2w ago
No description
vince
vinceβ€’2w ago
the css for this is really bad but im done tinkering with it
No description
vince
vinceβ€’2w ago
sorry hijacked the post but it was too challenging not to try it lol
b1mind
b1mindβ€’2w ago
It's a good nerd snipe
roelof
roelofOPβ€’2w ago
If it's possible I would see b1 and vince pen πŸ™‚
vince
vinceβ€’2w ago
Definitely could have been written better both the html and css so take with a grain of salt https://codepen.io/vince1444/pen/wBBKKOv
roelof
roelofOPβ€’2w ago
Thanks, time to study it
b1mind
b1mindβ€’2w ago
I was playing at making it a bit more responsive but didn't finish.
roelof
roelofOPβ€’2w ago
Both thanks so this is a more hard one to make responsive as I thought
vince
vinceβ€’2w ago
Max width 420px? πŸ˜‚ fitting
b1mind
b1mindβ€’2w ago
Not really I just couldn't think last night when I was doing it
vince
vinceβ€’2w ago
You definitely did some more advanced stuff than me I need to learn more grid stuffs
b1mind
b1mindβ€’2w ago
Oh I messed up my gradient too πŸ˜‚
vince
vinceβ€’2w ago
Lol I just used a gradient generator and played with the number til it gave me something I wanted I suck at gradients
b1mind
b1mindβ€’2w ago
Coding when tired πŸ˜‚ Only thing I see (on mobile) is I just defined the templates to control the sizing of tracks. This plays into how it squishes too Mmmm editor is not letting me type on phone wtf πŸ˜’ ah well I should get back to fam

Did you find this page helpful?