Title: Improving a Responsive Photo Gallery – Any Pro Tips?

I'm building a responsive photo gallery using best practices: •rem units •responsive images •max-width for layout Any suggestions to improve it ? Would love to hear advanced tips or creative ideas! Codepen link: https://codepen.io/Myra-Gull/pen/pvJxexO?editors=1100
10 Replies
vince
vince3mo ago
Look into the 8 point rule for values like font-sizes, margins, paddings... pretty much everything
vince
vince3mo ago
Cieden
What are spacing best practices (8pt grid system, internal ≤ exte...
In 9 mins, our Karyna Khmelyk explains how to use an 8pt grid system and the internal ≤ external rule. A must-read for anyone looking for the best spacing practices.
vince
vince3mo ago
Doesn't have to be 8, the point (no pun intended) is to be consistent Personally I increment by .125 or 1/8ths
Myra
MyraOP3mo ago
Thanks! I'll check it out
ἔρως
ἔρως3mo ago
instead of <div class="img"> use <picture>
.container {
width: 100vw;
}
.container {
width: 100vw;
}
what if the width of the device isn't 100vw? when you rotate the phone, there's buttons on the sides and what not use 100dvw or 100% instead
.card {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 1.4rem;
}
.card {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 1.4rem;
}
consider using em for paddings and margins <p class="title">Wireless Headphones</p> <-- sounds like an <h2>
Kevin Powell
Kevin Powell3mo ago
anything with width: 100vw will cause overflow on devices with fixed scrollbars, like windows + chrome... (dvw won't fix that)
No description
Kevin Powell
Kevin Powell3mo ago
You can remove that line, the container is already taking up the full width anyway, it's a block element🙂
ἔρως
ἔρως3mo ago
i forgot that block elements are already 100% width for the .desc, consider using text-wrap-style set to pretty or balance the alt text is also pretty unusable "watch-image" imagine you're blind or the image doesn't load all we see is that: watch-image
ἔρως
ἔρως3mo ago
No description
ἔρως
ἔρως3mo ago
at least add some italic, so the alt look out of place

Did you find this page helpful?