Tanmay Chandhok

Tanmay Chandhok

20 Articles Published

Articles by Tanmay Chandhok

Page 2 of 2

Animating a rainbow heart from a square using CSS?

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 432 Views

We can create visually appealing animations using CSS that transform shapes and change colors dynamically. CSS provides powerful animation properties that make it easy to create engaging visual effects on webpages. In this article, we will create an animated rainbow heart that transforms from a square shape and cycles through different colors every 3 seconds using CSS keyframes and transforms. Syntax @keyframes animation-name { 0% { property: value; } 50% { property: value; } 100% { property: value; } } selector { ...

Read More

Adding a mask to an image using CSS

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 373 Views

The CSS mask-image property allows you to create a layer over an element that can hide parts of it either partially or completely. This property is particularly useful for creating visual effects on images and text. Syntax selector { mask-image: none | | linear-gradient() | radial-gradient() | initial | inherit; } Possible Values ValueDescription noneNo mask is applied (default) Uses an image as the mask linear-gradient()Creates a linear gradient mask radial-gradient()Creates a circular gradient mask initialSets the property to its default value inheritInherits the value from parent element ...

Read More

Difference between resetting and normalizing CSS?

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 4K+ Views

Developers want HTML elements to look the same across all browsers. However, each browser applies its own default styles to HTML elements, which can cause inconsistencies. For example, heading tags may have different sizes, fonts, margins, or padding depending on the browser used. This tutorial explains CSS resetting and normalizing techniques, and the key differences between them. What is CSS Resetting? CSS resetting is a technique that removes all default browser styles by setting them to null or uniform values. This approach ensures a completely clean slate for styling, eliminating cross-browser inconsistencies caused by different user agent ...

Read More

Why does div display: table-row ignore margin?

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 1K+ Views

The CSS display: table-row property ignores margin because table elements follow the CSS table model, where margins don't apply to internal table components like table-row and table-cell. Instead, spacing is controlled by the border-spacing property or by applying margin to nested elements. Syntax .element { display: table-row; /* Margins will be ignored */ margin: 20px; /* This won't work */ } Why Table Rows Ignore Margin The CSS specification states that margin properties don't apply to elements with display: table-row, table-row-group, table-header-group, table-footer-group, table-column, table-column-group, or ...

Read More

Maintenance with CSS

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 1K+ Views

CSS (Cascading Style Sheets) is used to style HTML elements and is responsible for the look and feel of webpages. It allows you to change colors, backgrounds, fonts, spacing, and layout. One of CSS's greatest strengths is its maintainability — the ability to make site-wide changes quickly and efficiently. In this article, we'll explore how CSS makes web development maintenance easier and examine its key benefits and limitations. Advantages of CSS Following are the major advantages of using CSS − Time Saving Through Reusability CSS allows you to write styles once and reuse them across ...

Read More

Em vs Rem units in CSS?

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 652 Views

In CSS, you can use two types of units for sizing elements: absolute units (like px, cm, mm) and relative units. Relative units are particularly useful because they scale relative to other elements, making your designs more flexible and responsive. In this tutorial, we will compare the em and rem units in CSS, two important relative units that behave differently based on their reference point. Syntax selector { font-size: value em; /* relative to parent element */ margin: value rem; /* relative to root ...

Read More

CSS Viewer Chrome extension which is made for developers

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 417 Views

CSS viewer extension is a Chrome extension which acts as a property viewer and was made by Nicolas Huon. The user has to click on the toolbar icon and then hover the cursor on any element to view the element's CSS properties. This extension helps developers quickly inspect and understand the styling of any webpage element. In this article, we will explore what the CSS viewer extension is and how to use it effectively for web development. What is CSS Viewer Chrome Extension The CSS viewer extension is a developer tool that allows you to instantly view ...

Read More

Creating an Advanced Loading Screen in CSS

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 1K+ Views

Creating an advanced loading screen in CSS enhances user experience by providing visual feedback during page loading or processing. These animated loading indicators keep users engaged while content loads in the background. Syntax @keyframes animation-name { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .loader { animation: animation-name duration timing-function iteration-count; } Method 1: Circular Progress Loader This example creates a circular loading screen with a percentage indicator and animated border − ...

Read More

Difference between Auto-fit vs Auto-fill property in CSS grid

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 1K+ Views

CSS Grid provides powerful tools for creating responsive layouts, with auto-fit and auto-fill being key properties that help manage column behavior without media queries. Both work with the repeat() function to create flexible grid layouts. Syntax .container { grid-template-columns: repeat(auto-fill, minmax(min-width, 1fr)); /* or */ grid-template-columns: repeat(auto-fit, minmax(min-width, 1fr)); } Auto-fill Property The auto-fill property creates as many columns as possible to fit the container width, including empty columns. Empty columns maintain their minimum width, creating visible gaps. Example The ...

Read More

How to align block elements to the center?

Tanmay Chandhok
Tanmay Chandhok
Updated on 15-Mar-2026 5K+ Views

The margin property in CSS can be used to center a block element like a div horizontally. By setting the left and right margins to auto and defining a specific width, block elements can be centered within their container. Syntax selector { margin: auto; width: value; } Understanding Block Elements Block elements naturally take the full width of their container and start on a new line. Common block elements include , , , and . To center these elements, we need to give them a specific ...

Read More
Showing 11–20 of 20 articles
« Prev 1 2 Next »
Advertisements