Ofte falder jeg over fede scripts, CSS eller andet, som jeg gerne vil bruge i projekter på et tidspunkt. Dem gemmer jeg her på siden. Du skal være velkommen til at bruge dem.
Animering af display fra block til none
Animation af elementer når display er sat til block er ikke specielt nemt, da værdien none bliver sat med i samme øjeblik CSS’en afvikles. Før i tiden skulle man rode med Javascript til den slags, meeeen, nu findes der heldigvis en (forholdsvis) nem løsning med ren CSS, der kan det samme.
Se mereQuick look at nth-of-type
The nth-of-type selector allows you to select elements based on their position within a parent container. This opens up alot of possibilities for styling elements dynamically without using additional classes. Here’s how it works In the example below we use nth-of-type(n + 2) to select all div elements that are siblings of the same type […]
Se mereGrid and min max width in CSS
Creating responsive layout can sometimes be tricky. There are many scenarioes you have to take into account and the old I-just-go-with-desktop-tablet-and-mobile doesn’t cut it anymore. But luckily there are some cool features in CSS to fix this. Flexible layout Combining display grid with min-max functions you have a powerfull tool for responsive layout in CSS. […]
Se mereMake child element break out of parent container
I came across a cool feature in CSS where you can apply box-shadow and clip-path to an element inside a container to achieve an effect where the selected element fills the entire width of its parents parent container. This is ususally a tricky task, because the element is limitied to the width of the parent […]
Se mere