portfolio filter gallery html css javascript

How we can create a portfolio filtering using HTML CSS & JavaScript? Solution: Portfolio Filter Gallery With HTML CSS & JavaScript. In Other Words, Simple Image Category Filtering.

When we visit the portfolio section on any website, there we can see different categories. Suppose we visit a designer website then we can see his/her works, with all the photos we will see categories like Mockup, Web Template, etc. If we click on Web Template then only template design will appear, left others will hide automatically. That is Portfolio Filtering.

Today you will learn to create a portfolio category filtering, Using this you can filter out images by categories. This program will very helpful for any type of website. This portfolio has a flat design, you will definitely like to add on your website. This portfolio filter program very easy to understand, you can modify & recreate it easily.

So, Today I am sharing Portfolio Filter Gallery With HTML CSS & JavaScript. Basically, this is Images Category Filtering program, it can show images sort by categories. At first, it will show all images when you click on a single category then it will show images of the particular category. In short, we can filter images using this category filtering program.

If you are thinking now how this Portfolio Filter Gallery actually is, then see the preview given below.

Preview of CSS Flat Portfolio With Filtering

See this video preview to getting an idea of how this flat portfolio looks like.

Now you can see this visually. If you like this then get the source code of its.

You May Also Like: 

Portfolio Filter Gallery HTML CSS and JavaScript Source Code

Before sharing source code, let’s talk about it. As you know I have used HTML, CSS, & JavaScript for creating this program. Also with these, I used bootstrap to creating the layout easily. I just added bootstrap’s CDN Link in between head tags and used grid properties like container-fluid, col-md, etc.

I have created two compartments, First for category buttons second for images. In both, I have placed data-class=" ", The data-* attribute is used to store custom data. This data-class helps to connect categories with images. For example, I put ‘design‘ value for the web design category inside the data-class now I put the same data-class on all images related to web design.

In CSS sections, I placed all category divs and images in the right place.  Left other things, like hover color, link active color, etc is handled by CSS. This program has a responsive design using CSS @media query. On small screens, a single image will cover fully width & get positioned by top to bottom.

Using JavaScript, I fetched the list of categories I have created in HTML file, & fetched all the images also. After that, I have created a function of if-else. Created the condition, when we click on all the all images with visible but when we will click on a single category then only images will visible of the category. This condition is possible using a loop, which runs 0 to all images count.

That is the concept of filtering portfolio, I think I gave all important information left other things you will understand easily after getting the codes. For creating this program you have to create 3 files, first for HTML, second for CSS, & third for JavaScript. Follow the steps to creating this without any trouble.

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.

function.js

The last step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created Portfolio Filter Gallery Using HTML CSS & JavaScript, an Image Category Filtering program. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

5 COMMENTS

  1. Portfolio Filter Gallery HTML CSS & JavaScript | Image Category Filtering(please make same image gallery in php mysqli and category name and their respective images fetch from database)
    Please make this image gallery in php and mysqli :
    in this in li section heading or category name shows from database and cahnge images according to category name.

LEAVE A REPLY

Please enter your comment!
Please enter your name here