Perfecting the Grid Structure

Looks like you could loose the float too

.nav a {
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
}
1 Like

Yes, the float was only useful when the grid wasn’t being used. It’s ignored with the grid, as the grid does a much better job of controlling things for you.

Overflow isn’t needed either now because that was only used when I was using float, correct?

overflow: hidden;

Or am I wrong?

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}
2 Likes

Several versions ago it was also being used to hide the bottom margins on the floats.
Your fixed width and height on the wrapper was essentially containing the floats too.

We had overflow in there to future proof it. (in case changes were made )

1 Like

Yes, it just stacks the children like blocks from one column/row to the next

1 Like

Want to see something truely cool? An awesome image-grid tutorial (#8 in the list) that properly handles different sized images.

1 Like

Do I need t use any of these?

You already are.

I am, where?

You are using the two axis of grid layout.
Aligning and justifying aren’t relevant because you want the link boxes to fully take up the space.
Centering is of no use for you either.
Aligning and justifying could use space-between, but it has no effect on your layout.

So you are already using all of it that is useful do you.

2 Likes

specifying

margin:0;
padding:0;

Isn’t either?

.nav {
  display: grid;
   height: 100%;
}

It’s not needed?

Margin maybe, but that’s already handled by the wrap.
Padding is already handled with the grid-gap.

@Ray.H may know whether margin needs to be added, or @PaulOB would know.

Those were used on the original <ul> to remove default margins and paddings.

No longer needed

1 Like

Thanks.

1 Like

There’s a huge issue I just spotted.
@Ray.H

Click the white space below the links image.

How do I fix that?

Just change the height.

There’s nothing wrong with the height.

There shouldn’t be 2 scrol bars:

Yes there is - you saw it yourself.

There also shouldn’t be that gap below the vertical lines.