
Design comparison
Solution retrospective
My background-color on div.activity-content cannot fully cover the background-color on section.activity-card, and I still don't know how to fix it elegantly.
I reluctantly use "background: linear-gradient(to bottom, var(--color-work) 55px, var(--Very-dark-blue) 55px 100%)" on section.activity-card.
Anyone can give me some suggestion?
Community feedback
- @mbank14Posted 3 months ago
Hello, maybe you don't need to use a gradient and can just use a solid color like this:
&:nth-of-type(1){ background: var(--color-work); }
0@calvinvinPosted 3 months agoAs I said, if I don't use this approach, the dark blue color of div.activity-content cannot fully cover the bottom colors (orange, purple, yellow, ...etc) of the section.activity-card at the border, which may be due to some width calculation issue?
Any suggestions?
0@mbank14Posted 3 months ago@calvinvin I know where the problem is, because on other cards there is a
<p>
element that becomes 2 lines, for example "Yesterday - 1hr", and due to the padding, the size ofdiv.activity-content
changes.
Maybe you can try addingmin-height: 85%
todiv.activity-content
, or reduce the grid gap.Marked as helpful1@calvinvinPosted 3 months agohummmm...I don't get it exactly. The
div.activity-content
should take up all the remaining height and match the exact bilateral and bottom border of thesection.activity-card
, irrespective to the padding.I tried adding
min-height: 85%
todiv.activity-content
, the problem at bottom solved. But that is because thediv.activity-content
outflowed the bottom ofsection.activity-card
. And the problem at bilateral border persists (still some hair-thin leak of background-color of thesection.activity-card
).For cancelling the grid gap of
main.dashboard-wrapper
, it didn't make a difference.I still favor it's the issue of some length calculating issue at decimal scale. But I don't know how the others deal with it at this scenario.
Much thanks for your time to help me! :)
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord