DEV Community

Cover image for 5 CSS Properties You May Not Know
Abdullah Furkan Özbek
Abdullah Furkan Özbek

Posted on • Updated on • Originally published at blog.furkanozbek.com

5 CSS Properties You May Not Know

1. all property

The all property resets every other property (apart from unicode-bidi and direction) properties to their initial or inherited state.

.-reset {
  all: initial;
}
Enter fullscreen mode Exit fullscreen mode

2. calc property

The calc() function can be used to create values. For example: width: calc(100% - 50px) will make element full width minus 50px pixels.

width: calc(100% - 1em);
Enter fullscreen mode Exit fullscreen mode

3. column-count

The column-count property specifies the number of columns an element has. column-count: 3 will spread the elements text (or inline-* elements) into 3 columns.

4. currentColor

The currentColor keyword represents the calculated value of the elements color property.

.parent {
  color: #ccc;
  border: 1px solid currentColor;
}
.child {
  background: currentColor;
}
Enter fullscreen mode Exit fullscreen mode

5. filter

The filter property applies visual effects to elements. It comes with predefined functions like blur, brightness, contrast, sepia; and you can also apply custom SVG filters.

.-blur {
  filter: blur(8px);
}

.-brightness {
  filter: brightness(1.5);
}

.-contrast {
  filter: contrast(250%);
}

Enter fullscreen mode Exit fullscreen mode

6. Links

Top comments (0)