CSS provides a variety of effects that can be applied to HTML elements, such as shadows, gradients, transitions, transforms, and filters. Here are some examples of popular CSS effects:
Box shadow effect: Adds a shadow to an element. It can create a 3D effect and make elements stand out. Here’s an example:
.box {
box-shadow: 5px 5px 5px #888888;
}
Gradient effect: Applies a gradient color to an element. It creates a smooth transition between colors and can add depth to a design. Here’s an example:
.box {
background: linear-gradient(to bottom, #00c6ff, #0072ff);
}
Transition effect: Smoothly animates changes to an element over a specified duration. It adds a professional and polished look to a website. Here’s an example:
.button {
background-color: #4CAF50;
transition-duration: 0.4s;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button:hover {
background-color: white;
color: black;
}
Transform effect: Applies various transformations to an element, such as scaling, rotating, and translating. It creates dynamic and interactive elements. Here’s an example:
.box {
transform: rotate(45deg);
}
Filter effect: Applies various filters to an element, such as blurring, adjusting brightness and contrast, and adding color effects. It can add artistic effects to images and create unique designs. Here’s an example:
img {
filter: grayscale(50%);
}
These are just a few examples of the many effects that can be achieved with CSS. By combining these effects and using them creatively, you can create beautiful and dynamic web designs.
Learners TV is a website that is designed to educate users and provide instructional material on particular subjects and topics.