html css load more feature

Load More Feature With HTML & CSS Only Example and Source Code. You must have seen load more buttons before. Many websites use this feature of a clean look, they hide their content when you click on load more button, then the content will appear. This is a pretty cool feature you must use on your website.

This type of Load More feature can be done with JavaScript, JQuery or any javascript library. In WordPress, this is a common theme feature. Now the question is that, how can we create this program with only HTML & CSS. Yes, you hear right. You can create a Load More program in pure HTML and CSS.

I know this program will be very simple, as you know I always share simple stuff because they are easy to understand. But if you are a beginner or want to learn from scratch, then you are in the right place. Many people create this on JavaScript but they can’t do with pure CSS. Then this post also for those people.

Preview Of This Load More Program

First see a preview of this program, before getting the source code.

Now you got an idea about how will be this program looks. You can set this feature in your websites home page or portfolio page etc. Once you get source code then you can fully understand hows this program run. Then you can customize the whole program as you want.

You May Also Like:

HTML & CSS Load More Feature Source Code

Before sharing source code, I want to say a little bit about this program. This feature work with the help of CSS. I used an external CSS library called ‘Normalized’ (know about normalized CSS Library). As you can see above in preview video the blue boxes, I created these with HTML <li> ><ul> tag. You can use these <div> also. The in CSS by default hide some % of elements when you click on ‘load more’ button the height will be increase. Then we can see all the elements.

You have to create 2 files for this simple program. On for HTML, and other for CSS.

index.html

Create a file named ‘index.html‘ and any name as you want, and copy these codes given below & paste there.

style.css

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

That’s It. Now you have successfully created Load More Feature In Only HTML & CSS. If you have any doubt or question you can comment down below.

Thanks For Visiting, Keep Visiting.

17 COMMENTS

  1. It is a nice tutorial. But technically I’d rather consider this a “show more” than a “load more”. A “proper” load more script acquires the extra content with an own request to the server. It is a nice trick for a sleeker website but not a bandwidth safer.

  2. The title should be “Show More Feature… ” because usually when you say Load More it means you are going to load extra data from a source but here, everything is technically loaded you are just showing more things 🙂
    Unless you mean the illusion of loading more but for developers just the illusion is pretty useless
    Still, thanks for sharing your knowledge

  3. Very cool way in CSS but didn’t we want to do that in JavaScript to only load the invisible content after the user want it by clicking on the button? Like Facebook only load the content visible by view port? Where is the benefit from this in this context?

    Kind regards, Marcel

  4. That’s show more not load more as the initial load will get all content. With that set worth to mention that there is no speed benefit from that at all.

      • Sry, but no. It is show more. Load more means load extra data from a backend. So get data from a server. As you can see some more comments about it. Show more means exactly what you created. Not more. The data ist still there but hidden. Loading is different from showing. The title is wrong.

  5. I have to agree with others on How the post is about Show more and not Load More…. I think you should take some time to make the changes so as give proper information.

    Thanks for the tut.

  6. I recommend you to add the following things to prevent some issues. I modified it to remove the boxes and it appeared as list items, however the “Load more” button was really buggy and not quite hoverable or clickable – only a small area was clickable. The issue was that the text was overlaying the button, so having only opacity is not enough. Adding display would be one solution, but then it loses the transition animations. I found that adding visibility in addition to the opacity fixed the issue. That way, the text is properly hidden and does not mess with any other elements.

    add “visibility: hidden;” to:
    .load-more-container ul li:nth-child(1n + 5) {visibility: hidden;}

    and add “visibility: visible;” to:
    .load-more-container #load-more:checked ~ ul li:nth-child(1n + 5) {visibility: visible;}

LEAVE A REPLY

Please enter your comment!
Please enter your name here