pure css content filter

How we can create a content filter using pure HTML and CSS? Solution: Check out this Pure CSS Content Filter With Smooth Switch, HTML CSS Category Filter.

Previously I have shared Category Filtering program, this is like that but using pure CSS. Basically, Content filtering a method to filter out different types of content by choosing their category. Filter program is common on all types of website, that can be eCommerce, blog, news site, etc.

Today you will learn to create a category filter program using only HTML and CSS. There is 3 types of color boxes and also 3 buttons for selecting boxes types. When you will select the red box button then only that colors box will visible other will hide. That’s thing create this a type of category filter, we can use images or cards replacing the boxes.

So, Today I am sharing Pure CSS Content Filter With Smooth Switch. This program is purely in HTML and CSS, there are no JS or any other libraries. This will be very useful for you, and even a beginner can understand easily the codes. This program is originally published by Mr. Sam Gordon, I saw that on the dribble.

If you are thinking now how this category filter actually is, then see the preview given below.

Preview Of HTML CSS Category Filter

See this video preview to getting an idea about how this content filter looks like.

Live Demo

Now you can see this visually, you also can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

Pure CSS Content Filter With Smooth Switch Source Code

Before sharing source code, let’s talk about it. First I have created category filter and reset buttons using HTML <input>  tag and used a label for each input. There I have used id and for method with input and label (info). After that, I have created some divs for creating the boxes, in the div places two class name one is ‘box‘ which is common in all the divs and other are colors names.

As you can see in the preview there are three types of color I have randomly placed class name in divs for colors, like for red I have put class name red. Now using CSS I have placed all the elements on right places, I gave label and divs width 23%. That’s creating the type of responsive design, means it will fit on every screen size. And all three class which are red, green, and blue put their background color according to their name.

For creating the filter, I gave some condition using CSS. The conditions are when we click on the red category button that’s mean the red button checked, and when red button checked then other blue and gree boxes width and height will be 0. The same condition is in other color boxes.

Left all other things you will understand after getting the codes, I can’t explain more in writing. For creating this program you have to create only two files, one for HTML and one for CSS. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

That’s It. Now you have successfully created Pure CSS Content Filter With Smooth Switch, HTML CSS Category Filter. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here