Trying to bring two items closer together inside a grid on different rows

https://codepen.io/bsups/pen/yLGOZBL At the bottom trying to bring the name Michelle Appleton and the date closer together. Im pretty sure I had it working last night, but decided to redo it because I wanted the button to be more dynamic rather than replace by new html. (I despise this Frontend Mentor layout) I have tried all the justifies and align options, the elements height, and messing with margin.
6 Replies
Chooβ™šπ•‚π•šπ•Ÿπ•˜
You could set a line-height on the paragraph tags.
snxxwyy
snxxwyyβ€’15mo ago
@bsups it's because your body tag has line-height: 2em; on it, you would decrease the line height on the paragraph tags as choo said, i'd recommend doing so with a utility class since i gather you wouldn't want to target every paragraph on the website and it isn't recommended to target the tags specfically e.g. <p></p> since they aren't meant to be used for styles. for example you could do this:
<div class="user--wrapper">
<img src="images/avatar-michelle.jpg" alt="" class="user__img" />
<p class="user__name small-lh">Michelle Appleton</p>
<p class="user__date small-lh">28 June 2020</p>
</div>
<div class="user--wrapper">
<img src="images/avatar-michelle.jpg" alt="" class="user__img" />
<p class="user__name small-lh">Michelle Appleton</p>
<p class="user__date small-lh">28 June 2020</p>
</div>
.small-lh {
line-height: 1.5;
}
.small-lh {
line-height: 1.5;
}
Chooβ™šπ•‚π•šπ•Ÿπ•˜
.user--wrapper p{
line-height: 1.5;
}
.user--wrapper p{
line-height: 1.5;
}
Would also work.
snxxwyy
snxxwyyβ€’15mo ago
^
Errtu
ErrtuOPβ€’15mo ago
Thank you all. Sorry my brain was fried and forgot to look outside the box… or well div.
snxxwyy
snxxwyyβ€’15mo ago
no worries!
Want results from more Discord servers?
Add your server