having trouble with row gaps
I'll share code in a reply but im having trouble with row gaps not working. Trying to space these rows just a little bit so names and pics aren't so close together. I know im doing something wrong. Please let me know
30 Replies
here's my css
html
trying to get close to this
Unsure why you had 3 separate
row
? I have treated this as part of the problem, but let me know if this was intended for a reason?
- this is grid so we have full control of the children from the parent.
- this means we can remove those surrounding div tags.
- this also means that putting gaps between the rows is a simple matter
have updated your layout and row classes slightly.
and removed any .row div that was wrapping the items
the issue I see with this is that the sizing of your element is not responsive. So you would need to make this responsive somehowI was just following the source code of the goal image I shared. The site i got it from used separate divs
the grid-row-gap doesn't do anything in your css if you want to put the space between rows you need to set
.layout
to a grid then you can use grid-row-gap
or just put margin-block-end
on .row
to space them outInteresting why does it need to be layout?
why? because of how you structured your html
grid-row-gap
affect the children of the grid box in your case it would be .item
So the best thing to do is make
.layout
the grid?yes and remove the
row
so all the item
are a child of layout
Hmm ok
Would that make it responsive
depends on how you set your grid-template-columns
I'm sticking with 4 columns
Unless screen gets smaller then maybe 1
use media query to change that 🙂
So should I drop the rows and just make them all items? I'm trying to keep names underneath pictures
I would switch from all those divs to figure + figcaption https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
: The Figure Caption element - HTML: HyperText Markup Language | MDN
The HTML element represents a caption or legend describing the rest of the contents of its parent element.
treat figure as a div with the class item
Hmm ok
been trying things as suggested
seems like im not getting it perfect
What are you trying to do right now?
That's what I was able to make so far
I just need to do color transition on the names to give them a kind of glow when hovered over
Then work on getting it responsive for smaller devices (single column stack)
Just select whatever text or paragraph, like:
Aiming for
Yeah, simply go for that example.
seems weird getting landscape and portrait layouts right
I used this here
just seems like the landscape vs portrait views look messy when transitioning
shouldnt be doing that
Could you maybe post it in a codepen? Would be much easier having the whole thing.