Dynamic columns using flexbox
Here is a neat way of defining a dynamic number of columns using
flexbox
. And the best part is that it doesn't use any media
queries!
Try resizing your viewport and see how cards nicely stack on top of each other.
Hamburger menu with text-decoration
Inspired by
Kevin Powell's video
, this is an example of a simple "hamburger" style menu button with
text-decoration
.
Pure HTML counter
Few people know that you can create a counter using only HTML. This is a simple example of how to do it.
The magic happens by using a data
attribute to store the current
value of the counter. Then, we use the onclick
event to increment
its value.
In the onclick
event, we first convert the value of the counter
to a number using the +
operator. Then, we increment it by one.
We use the comma operator to discard the assignment and set the text content
of the button to the new value.