CSS Articles

Page 16 of 130

How to create animated banner links using HTML and CSS

Aman Gupta
Aman Gupta
Updated on 15-Mar-2026 5K+ Views

We can create animated banner links using HTML and CSS to make advertisements and call-to-action buttons more engaging. HTML provides the banner structure while CSS handles styling and animations to draw user attention and increase click-through rates. Syntax a { animation: animation-name duration timing-function direction iteration-count; } @keyframes animation-name { 0% { /* initial styles */ } 50% { /* middle styles */ } 100% { /* final styles */ } } Example: Animated Banner Link The ...

Read More

How to create Area Chart using CSS

Aman Gupta
Aman Gupta
Updated on 15-Mar-2026 384 Views

An area chart is a graphical representation of data that displays quantitative information by filling the area between a line and the axis. Using CSS custom properties and the clip-path property, we can create visually appealing area charts directly in the browser without external libraries. Syntax .area-chart { clip-path: polygon(x1 y1, x2 y2, x3 y3, x4 y4); --start: value; --end: value; } Key Components To create an area chart, we need these essential elements − CSS Custom Properties − Variables ...

Read More

How to Create the Animated Loader Ring using HTML and CSS?

Aman Gupta
Aman Gupta
Updated on 15-Mar-2026 746 Views

A loader ring is an animated component that provides visual feedback to users while content is loading. Using CSS animations, we can create an engaging spinning ring effect that enhances user experience during data loading processes. Syntax .loader { border: width solid color; border-radius: 50%; border-top: width solid accent-color; animation: spin duration timing-function iteration-count; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } Key ...

Read More

How to create an Animated bars using HTML and CSS?

Aman Gupta
Aman Gupta
Updated on 15-Mar-2026 1K+ Views

Animated bars are visually appealing elements that simulate music equalizer bars or loading indicators. Created using HTML for structure and CSS for styling and animation, these bars use CSS transform and @keyframes properties to create smooth scaling effects. Syntax @keyframes animationName { 0% { transform: scaleY(1); } 100% { transform: scaleY(value); } } .element { animation: animationName duration infinite alternate; animation-delay: delay-time; } Example: Basic Animated Bars The following example creates a set of animated bars that ...

Read More

How to create a working slider using HTML and CSS?

Aman Gupta
Aman Gupta
Updated on 15-Mar-2026 4K+ Views

A CSS slider creates a slideshow animation where users can navigate between different images using navigation buttons. This component uses radio buttons, labels, and CSS :checked pseudo-selectors to control which slide is visible without JavaScript. Syntax /* Basic slider structure */ input[type="radio"]:checked ~ .slider-container { transform: translateX(-100%); } .slider-container { display: flex; transition: transform 0.3s ease; } Key Components ComponentPurpose Radio InputsTrack which slide is active (hidden from view) LabelsAct as clickable navigation buttons :checked SelectorApply styles when a radio ...

Read More

How to make the cursor to hand when a user hovers over a list item using CSS?

Abhishek
Abhishek
Updated on 15-Mar-2026 321 Views

The CSS cursor property allows you to change the appearance of the mouse cursor when hovering over HTML elements. This is especially useful for list items to indicate they are interactive or clickable. Syntax selector:hover { cursor: value; } Possible Values ValueDescription pointerA pointing hand cursor, typically used for clickable elements grabAn open hand cursor, indicating something can be grabbed grabbingA closed hand cursor, indicating something is being dragged ...

Read More

How to add a custom right-click menu to a webpage?

Abhishek
Abhishek
Updated on 15-Mar-2026 3K+ Views

A custom right-click menu allows you to replace the browser's default context menu with your own styled menu. This provides better control over user interactions and creates a more integrated user experience. The process involves preventing the default browser behavior and displaying your custom menu at the cursor position. Syntax /* Hide custom menu by default */ #custom-menu { display: none; position: absolute; } /* JavaScript events */ document.oncontextmenu = function(event) { event.preventDefault(); /* Show custom menu */ }; ...

Read More

CSS units – %, em, rem, px, vh, vw

Abhishek
Abhishek
Updated on 15-Mar-2026 1K+ Views

CSS units determine how we measure and size elements on web pages. The most commonly used units include pixels (px), em, rem, percentages (%), and viewport units (vh, vw). Each unit has specific use cases and behaviors that affect responsive design and accessibility. Syntax selector { property: value unit; } Absolute Units Pixels (px) Pixels are fixed-size units representing the smallest display unit. While reliable for precise control, they don't scale with user preferences or viewport changes − .px-box ...

Read More

What are the different utility classes in Materialize CSS?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 421 Views

Materialize CSS is a popular front-end development framework that offers various features and utilities to create responsive and appealing web applications. One of the essential components of Materialize CSS is its utility classes, which provide an easy and efficient approach to adding styles to HTML elements without writing custom CSS. Utility classes are predefined CSS classes that can be applied to any HTML element to achieve specific styling effects quickly and consistently. Types of Utility Classes Color utility classes − for text and background colors Alignment utility classes − for text and element positioning Hiding/showing content ...

Read More

Use of :even and :odd pseudo-classes with list items in CSS

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 6K+ Views

CSS :nth-child(odd) and :nth-child(even) pseudo-classes are used to select alternative child elements. These pseudo-classes work with list items to create alternate styling like text color and background, which improves readability and visual organization. Syntax /* Select odd-positioned elements */ selector:nth-child(odd) { property: value; } /* Select even-positioned elements */ selector:nth-child(even) { property: value; } CSS :nth-child(odd) Pseudo-Class The :nth-child(odd) pseudo-class selects elements that are at odd positions (1st, 3rd, 5th, etc.) within their parent container. Example In this example, we use :nth-child(odd) to ...

Read More
Showing 151–160 of 1,299 articles
« Prev 1 14 15 16 17 18 130 Next »
Advertisements