I have this codepen, where the first “3” areas (Random Text 1/2/3) should all be empty. They should move further down the line, if that makes sense . I need to somehow designate the first 3 areas as “do not use”. I’ve looked through this documentation and I’m trying to avoid giving a specific template area name to each individual box (10 total boxes if you do 2 rows x 5 columns) and manually specifying content.
The ultimate goal was to create 2 lines of links, 2 in the first row (aligned to the right) and the next row to have the rest of the links (in this case, 5). Figured this was a good time to practice grid .
Any clue how I’d fix the right alignment? I can see how the grid boxes are laying out…I tried a value of “min-content” but that causes text wrapping on my live example (and white-space: nowrap brings me back to the original problem .
I’m leaving this for now due to real life restrictions, but I might take another look at this tomorrow.
If you go into chrome inspector and highlight the parent in the HTML, you can see how the inspector adds the highlighted boxes around the children. If you look at the 2 columns, the far right item (along the righthand side)…the width of both rows are equal to the item with the longest text, which makes sense. This is a grid. That means the item with the shorter text is in that same grid but …
Ok, I just modified the codepen and added a background to the anchor. Hopefully that will show my issue. The last row needs to shift over to the right and be aligned with the edge of the parent.
That’s what I’m seeing too. I’m just wondering if it has some combination where I can get this working. I’m guessing it’s not. The closest I have is on codepen right now, but I feel like I’m going to be stuck doing this in flex (and having to modify my given HTML to get it working). .
That’s why this is a grid learning experience. Whoops . I just knew flex couldn’t give me what I wanted without HTML modification. And with my CMS at work, the first thing you try to do is avoid HTML modification via Javascript. But here we are . Thanks Paul.