Code Snippets
Fade non-hovered links
Fade non-hovered links
A fun animation where hovering over links will fade out all the items except the hovered item.
<style>
.link-wrapper:has(.link-item:hover) .link-item {
opacity: 0.5
}
.link-item:hover {
opacity: 1 !important;
}
</style>
Similar Code Snippets
Balance text wrapping
Headings are crucial for grabbing attention and conveying key messages. However, unbalanced text lines can make headings less impactful. The text-wrap: balance; property helps distribute text more evenly across lines, reducing the occurrence of "widows" - a single word or short line at the end of a paragraph:
Custom Text Selection Colour
When users highlight text on your webpage, you have a unique opportunity to enhance the visual feedback with custom colors that match your brand. The ::selection pseudo-element allows you to style the background and text color of the selected text:
Move elements at different breakpoints
A useful javascript snippet that lets you move elements to a new location at different breakpoints. Perfect if you can only have 1 instance of an element on the page but it needs to change position.