July 17, 2026 in CSS

How to Create Auto-Expanding Textareas with CSS Only

We’ve all been there. You’re building a chat interface or a comment form, and you want that smooth, high-quality user experience where the text box grows as the user types—just like ChatGPT or iMessage. For years, this simple feature was surprisingly painful to build. You had to wire up JavaScript event listeners to calculate scrollHeight […]

July 10, 2026 in CSS, HTML

The CSS aspect-ratio Property: Finally, a Simple Fix

You must have used the padding-top hack at some point. If you have been writing CSS for a few years, you will remember it well. It used to work fine, but it always felt like a temporary fix, something we did because there was no proper solution at the time. We don’t need that workaround […]

December 1, 2025 in CSS, HTML

How to Animate a Background Image to Move Behind Text Using CSS?

Animating a background image behind text is a powerful visual effect that adds depth and motion to your typography. With modern CSS, you can achieve this using background clipping and keyframe animations—no JavaScript required. In this guide, we’ll walk through how to animate a background image so it smoothly moves behind your text. Why Animate […]

May 2, 2024 in CSS, HTML

Master CSS Grid Layout: Centering Content in Cells

To understand how centering works in a grid container, it’s first important to know the grid layout’s structure and scope. The HTML structure of a grid container consists of three layers: Each layer operates independently when it comes to applying grid properties. The scope of a grid container is limited to a parent-child relationship, meaning […]

April 16, 2018 in CSS, Bootstrap

Why Reboot is created for Bootstrap 4 instead of using Normalize?

You might have used normalize in your projects. Bootstrap 4 has created its on version on top of the normalize called reboot. If you are not familiar with normalize, it overwrites browser’s default CSS to eliminate browser inconsistencies, like different font sizes, or margin etc. It also add many CSS rules that helps you make […]

April 2, 2018 in CSS, Bootstrap

Understanding EMs and REMs

As we know Bootstrap 4 is using em’s and rem’s instead of pixels, so its necessary to understand what these units are, and how they work. Let’s take a look. There are few things that you should memorise about em’s and rem’s, these points will help you understand these units more easily.

October 26, 2017 in CSS

Horizontal & Vertical centering using flexbox module

Aligning content vertically inside a DIV or a box has always been an issue in CSS. There was some tricks available with display: table and display: table-cell properties. But it was never convenient to implement, until flexbox module came into the existence. With Flexbox, one can align anything (vertically or horizontally) with the align-items and […]

April 29, 2016 in CSS

Evenly spaced multi-line navigation using Flexbox module (CSS3)

Recently, in one of my project, the client asked me to create a multi-line navigation, which should be evenly spaced according to link text. One major consideration was that navigation should be dynamic and the number of links can be changed in future if needed.

November 14, 2014 in CSS, Snippets

How to remove dotted outline and input borders

Most browsers show a dotted line around links (anchor tags), this is an accessibility feature used for people who are not using mouse. When they are switching between links using tab key (or any other keys) on their keyboard, this dotted outline helps them in finding which particular link is currently selected, and then they […]

November 10, 2014 in CSS

Change color of text on selection

You can change color of text on selection using CSS, you can also change background color of selected text to highlight it on selection.