CSS Articles

Page 19 of 130

How to style icon color, size, and shadow by using CSS

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 3K+ Views

Icons are an essential part of any website or application, as they provide users a quick and easy way to understand and interact with content. Using CSS, we can style icon color, size, and shadow to create a unique and visually appealing user experience instead of relying on default styling. In this article, we will learn different methods to style icons using CSS properties to customize their appearance. Syntax /* For Font Icons */ .icon { color: value; font-size: value; text-shadow: horizontal vertical blur ...

Read More

What is CSS sprites and how to implement them on a page?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 246 Views

CSS sprites are a technique used to reduce the number of HTTP requests by combining multiple images into a single image file. Instead of loading several individual images, the browser downloads one sprite sheet and displays different portions using CSS background-position property. Syntax .element { background-image: url('sprite-sheet.png'); background-position: x-offset y-offset; width: image-width; height: image-height; } Benefits of CSS Sprites The main advantages of using CSS sprites include − Reduced HTTP requests: Multiple images are loaded with ...

Read More

What is CSS Flexbox?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 191 Views

CSS flexbox is a powerful layout model that makes it easier to design flexible and responsive layouts. It allows you to arrange child items efficiently within a container and automatically adjusts item dimensions when content overflows. Syntax selector { display: flex; } Terminology of CSS Flexbox Understanding these key terms is essential for working with flexbox − Flex container − An HTML element with display: flex applied to it. Flex items − Direct children of the flex container that are arranged using flexbox properties. Main axis − The ...

Read More

What are the real world usage of CSS with SVG?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 173 Views

CSS with SVG provides powerful styling capabilities for scalable vector graphics. SVG (Scalable Vector Graphics) are vector-based images created using mathematical functions rather than pixel grids, making them infinitely scalable without quality loss. When combined with CSS, SVG becomes a versatile tool for creating interactive, animated, and responsive graphics. Syntax /* Target SVG elements directly */ svg element { property: value; } /* Target SVG elements by class */ .svg-class { property: value; } /* Target SVG elements by ID */ #svg-id { ...

Read More

Various tricks for :before pseudo elements using position property in CSS

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 893 Views

The CSS :before pseudo-element allows you to insert content before an HTML element. When combined with the position property, you can precisely control where this content appears relative to its parent element, creating effects like custom icons, tooltips, notification badges, and styled form elements. Syntax selector:before { content: "text or symbol"; position: absolute | relative | fixed | static; top: value; left: value; right: value; bottom: value; } Example 1: Custom ...

Read More

Targeting only Firefox with CSS

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 5K+ Views

While developing web applications, developers must make them look consistent across all browsers. Some CSS properties are not supported by Firefox but work in other browsers like Chrome, Opera, etc. In such cases, we need to write CSS code that targets only the Firefox browser. In this article, we will learn two different methods to write CSS that targets only Firefox browsers. Syntax /* Method 1: Mozilla-specific CSS Extension */ @-moz-document url-prefix() { /* CSS code for Firefox only */ } /* Method 2: @supports Rule */ @supports(-moz-appearance:none) { ...

Read More

Logical Properties in CSS

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 338 Views

In CSS, logical properties allow developers to define styles based on the logical structure of the web page rather than the physical layout. This means you can apply CSS according to text direction or content flow, making your designs more adaptable to different languages and writing modes. Logical properties are primarily used to set HTML element's margin, padding, and border. They provide different variants of traditional margin, padding, and border properties that adapt to content flow direction. Syntax selector { property-block-start: value; property-inline-end: value; ...

Read More

Loading Text Animation Effect using CSS

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 2K+ Views

Loading text animations are essential for providing visual feedback to users while content loads. They improve user experience by indicating that something is happening in the background and keep users engaged during wait times. In this tutorial, we will learn to create different types of loading text animations using HTML and CSS. These animations are lightweight, smooth, and don't require JavaScript libraries. Syntax @keyframes animationName { 0% { /* starting properties */ } 50% { /* mid-point properties */ } 100% { /* ending ...

Read More

Is there any selector for elements containing certain text in CSS?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 10K+ Views

To select elements containing certain text in CSS, we can use CSS attribute selectors. We can either use pre-defined attributes or add custom attributes in the HTML document. Syntax /* Exact match */ [attribute="value"] { } /* Contains word */ [attribute~="word"] { } /* Contains substring */ [attribute*="substring"] { } /* Starts with */ [attribute^="prefix"] { } /* Ends with */ [attribute$="suffix"] { } Method 1: Using Attribute Value Selector The attribute value selector [attribute="value"] selects elements with an exact attribute value match − ...

Read More

How to specify order of classes using CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 1K+ Views

Cascading Style Sheets (CSS) is a powerful component of web development which enables the developers to determine the visual appearance of their websites. In CSS, classes are used as selectors which enables us to apply several specific styles to an element. You can also use multiple classes for a particular element. However, when you apply multiple classes to an element, it is necessary to know how to specify the order of these classes in which they will be rendered to avoid discrepancies and unexpected results. In this article, we will discuss different methods to specify the order of classes ...

Read More
Showing 181–190 of 1,299 articles
« Prev 1 17 18 19 20 21 130 Next »
Advertisements