Search
Please Give Me Some Space
3.6.2022
There’s all kinds of ways to do that. Some more advisable and better-suited for certain situations than others, of course.
We could do it directly in HTML:
<pWe go from one line...<br<brdown a couple more.</p
But that’s …
Please Give Me Some Space originally...
Scroll Shadows With JavaScript
6.10.2021
Scroll shadows are when you can see a little inset shadow on elements if (and only if) you can scroll in that direction. It’s just good UX. You can actually pull it off in CSS, which I think is …
The post Scroll Shadows With JavaScript appeared first on CSS-Tricks. You can support...
Not Your Typical Horizontal Rules
16.4.2021
The default browser style for <hr> is so weird. It’s basically:
border-style: inset;
border-width: 1px;
The default border-color is black, but the border doesn’t actually look black, because the inset border “adds a split tone to the line …
The post Not Your Typical...
CSS Findings From The New Facebook Design
7.4.2020
Ahmad Shadeed digs around the new Facebook’s front-end code.
One that stood out to me:
.element {
inset: 4px 0;
/* Which is equivalent to: top: 4px, bottom: 4px, left: 0, right: 0 */
}
Whaaat? This is the first I’ve heard of the inset property. Ahmad said he saw it working...
Link Underlines That Animate Into Block Backgrounds
23.9.2019
It's a cool little effect. The default link style has an underline (which is a good idea) and then on :hover you see the underline essentially thicken up turning into almost what it would have looked liked if you used a background-color on the link instead.
Here's an example of the effect on...
The div that looks different in every browser
13.7.2018
It's not that Martijn Cuppens used User Agent sniffing, CSS hacks, or anything like that to make this quirk div. This is just a plain ol' <div> using the outline property a la:
div {
inset 100px green;
outline-offset: -125px;
}
It looks different in different browsers because browsers...
CSS Environment Variables
4.5.2018
We were all introduced to the env() function in CSS when all that drama about "The Notch" and the iPhone X was going down. The way that Apple landed on helping us move content away from those "unsafe" areas was to provide us essentially hard-coded variables to use:
padding:
...