Open In App

10 CSS functions every Front End developer Should Know

Last Updated : 28 Jun, 2025
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

CSS functions are powerful tools that help you style websites more efficiently. They allow you to dynamically adjust values like colors, sizes, and positions, making your code cleaner and more maintainable.

Here are 10 essential CSS functions every front-end developer should know:

1. url() Function

The url() function is used to link external resources like images or fonts in your CSS. It’s commonly used for background images, list styles, and more.

background: url("photo.jpg")

2. calc() Function

The calc() function lets you perform calculations directly in your CSS. It’s useful for dynamically adjusting sizes, margins, or padding.

width: calc(100%-60px)

3. var() Function

The var() function is used to insert the value of a CSS variable. It’s great for reusing values and maintaining consistency across your styles.

--white: #fff
h2 { color: var(--white); }

4. rgb() and rgba() Functions

These functions define colors using red, green, and blue values. The rgba() function adds an alpha channel for