Progressive Full Stack Application Development with Live Projects
Used for dynamic calculations of values.
div {
width: calc(100% - 20px);
}
Allows you to use CSS custom properties (CSS variables).
:root {
--main-color: #3498db;
}
div {
background-color: var(--main-color);
}
Constrains a value between a defined minimum and maximum.
div {
font-size: clamp(14px, 4vw, 24px);
}
Returns the minimum value from a list of values.
div {
width: min(50%, 300px);
}
Returns the maximum value from a list of values
div {
width: max(50%, 200px);
}
Defines a color using red, green, and blue component
div {
background-color: rgb(255, 99, 71);
}
Defines a color using red, green, blue, and alpha (transparency).
div {
background-color: rgba(255, 99, 71, 0.5);
}
Defines a color using hue, saturation, and lightness.
div {
background-color: hsl(200, 100%, 50%);
}
Defines a color using hue, saturation, lightness, and alpha (transparency).
div {
background-color: hsla(200, 100%, 50%, 0.5);
}
Specifies a URL for resources like background images.
div {
background-image: url('image.jpg');
}
Rotates an element by a specified angle.
div {
transform: rotate(45deg);
}
Moves an element from its current position.
div {
transform: translate(50px, 100px);
}
Resizes an element.
div {
transform: scale(1.5);
}
Skews an element along the X and Y axes.
div {
transform: skew(30deg, 20deg);
}
Defines the perspective for 3D transformations.
div {
transform: perspective(500px) rotateY(45deg);
}
Defines a transition effect for properties.
div {
transition: all 0.3s ease-in-out;
}
div:hover {
background-color: #3498db;
}
Applies a shadow effect to an element’s box.
div {
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.1);
}
Applies graphical effects like blur, brightness, etc..
div {
filter: blur(5px);
}
Adjusts the brightness of an element.
div {
filter: brightness(0.5);
}
Inverts the colors of an element.
div {
filter: invert(100%);
}
These functions help in creating dynamic, responsive, and visually rich layouts. They allow for complex effects and transformations with minimal code.
CodeMerit is a virtual space for coding enthusiasts, beginners, professionals for upskilling and accelerating their learning journey and acquiring real work experience.
Know More