Safari doesn't support position: relative
on <tr>
elements
This is a problem if you want whole table rows to be clickable. Luckily there's a (hacky) workaround.
position: relative
on <tr>
elementsThis is a problem if you want whole table rows to be clickable. Luckily there's a (hacky) workaround.
margin: auto
Published on in CSS and CSS for JS Devs course
margin: auto
is not only for horizontal centering.
position: fixed
breaks if any of its ancestors uses transform
Published on in CSS and CSS for JS Devs course
Or perspective
or filter
.
This can easily cause confusing bugs.
Published on in CSS and CSS for JS Devs course
height
and width
work somewhat differently in CSS.
height
looks "down" the tree
whereas width
looks "up" the tree.
Published on in CSS and CSS for JS Devs course
Block elements stack on top of each other. Inline elements are placed side by side.
Published on in CSS and CSS for JS Devs course
Last updated on
It's frustrating when a CSS declaration is technically valid (not crossed out in the browser's DevTools) but has no effect for some reason. Firefox DevTools can often tell you why and also how to potentially fix those issues! (Update: Chrome 108+ can too.)
will-change
propertyPublished on in CSS
The will-change
property makes the browser render an element with the GPU,
which can reduce jankiness and also allows utilizing sub-pixel rendering.
But use the property sparingly.
display: flow-root
is better than the clearfix hackPublished on in CSS
The flow-root
value is clearer (no hacks!)
and has great browser support.
Published on in CSS
Polish your animations by animating based on actions or events, like mouse-enter and mouse-leave, instead of animating based on states, like default and hover state.
Published on in Clean code, CSS and JavaScript
Last updated on
These two similar principles state that the behavior of code should be obvious on inspection and that code should be located where it's relevant.
contenteditable
+ ::first-letter
+ Chrome = buggy comboPublished on in CSS
Last updated on
This combination causes weird behavior and data loss
because of a bug in Chrome,
so it's best not to use contenteditable
and ::first-letter
together.