Apply Different CSS Styles Based On Window Size (Responsively) Without Using JavaScript Window Event

Apply Different CSS Styles Based On Window Size (Responsively) Without Using JavaScript Window Event

Posted on

Switching CSS classes or properties based on screen size can be achieved using JavaScript as shown below. But handling such things with JavaScript window resize event is not as efficient to achieve it with CSS. Using Tailwind For example, if we want to create a feature where the child menu opens on mouseenter event and

Read More

Maintaining A 16:9 Responsive Aspect-Ratio Of An Image Using CSS

Maintaining A 16:9 Responsive Aspect-Ratio Of An Image Using CSS

Posted on

One of the greatest challenges developers face is to maintain an aspect ratio of multiple images with unknown dimensions. In this blog, we will learn just that. Let’s take an example of these two images with different dimensions. The problem is that we cannot give it a fixed height because the width will change in

Read More