How To Create A Blog Page Using HTML CSS And jQuery
We will create a blog website template using HTML, CSS, and JavaScript. This blog page template is completely responsive and easy to use in an HTML website. I also provide you HTML, CSS, And JavaScript Code which helps you to understand this Tutorial.
How to make a blog template website using HTML, CSS, and JavaScript
- 00:00 - 02:18 min : Intro
- 02:18 - 47.00 min: Create Blog website Using HTML, CSS, and JavaScript
This is the basic HTML which is important for all HTML files. I import Poppins in this HTML file using Styling from google because most people do not have Poppins font on their devices.
Blog Website
➤Blog Website HTML Code have given below.
Blog Musing, working, and everything in between.
- All
/- insights
/- projects
/- nb culture
/- news
insights Has covid eased some divisions? June 9 - 5 min read
project Inspiring media agencies and brands to use TikTok June 9 - 5 min read
insights Talent pool: Need better staff? Get better principles. June 9 - 5 min read
NB culture Our sustainability journey June 9 - 5 min read
News Inspiring media agencies and brands to use TikTok June 9 - 5 min read
NB culture Talent pool: Need better staff? Get better principles. June 9 - 5 min read
➤Blog Website CSS Code is have given below.
*{
margin: 0px;
padding: 0px;
font-family: poppins;
box-sizing: border-box;
}
body{
margin: 0px;
padding: 0px;
font-family: poppins;
background-color: #14171c;
width: 100%;
overflow-x: hidden;
-ms-overflow-style: none;
scrollbar-width: none;
}
body::-webkit-scrollbar{
display: none;
}
a{
text-decoration: none;
}
ul{
list-style: none;
}
::selection{
background-color: #ffffff;
color: #14171c;
}
/*==navigation=====================================*/
.navigation{
display: flex;
justify-content: space-between;
align-items: center;
padding: 30px 2%;
z-index: 2;
}
.menu{
display: flex;
}
.menu li a{
padding: 12px 20px;
color: #ffffff;
font-size: 0.9rem;
margin: 4px 10px;
letter-spacing: 0.5px;
transition: all ease 0.3s;
}
.menu li a:hover{
opacity: 0.8;
transition: all ease 0.3s;
}
.nav-contact{
background-color: #ffffff;
font-size: 0.8rem;
font-weight: 500;
color: #1c1f25 !important;
}
.logo{
background-color: #161616;
min-width: 50px;
height: 50px;
padding: 0px 10px;
border: 1px solid rgba(255,255,255,0.137);
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
font-weight: 700;
font-size: 1.6rem;
letter-spacing: 3px;
}
/*==page-container===============================*/
.page-container{
max-width: 1200px;
margin: auto;
display: flex;
flex-direction: column;
}
.top-bar{
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr;
border-bottom: 1px solid #9f9f9f48;
padding: 30px 0px;
margin: 5px auto 0px auto;
}
.top-bar span,
.article-number{
color: #9f9f9f;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 2px;
}
/*==blog=======================================*/
#blog{
display: flex;
flex-direction: column;
justify-content: center;
padding: 40px 0px;
}
.blog-heading{
margin: 20px 0px;
}
.blog-heading h1{
font-size: 5.2rem;
color: #ffffff;
line-height: 94px;
}
.blog-filter{
display: flex;
align-items: center;
margin: 40px 0px 20px 0px;
color: #78809e59;
}
.blog-filter li{
color: #ffffff;
text-transform: uppercase;
font-size: 0.7rem;
letter-spacing: 2px;
margin: 0px 5px;
cursor: pointer;
user-select: none;
}
.blog-filter li:hover{
opacity: 0.7;
transform: all ease 0.3s;
}
.blog-filter-active{
border-bottom: 1px solid #e2d40c;
}
.blog-container{
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 40px;
margin: 10px 0px 50px 0px;
}
.blog-box{
transition: all ease 0.3s;
}
.blog-box:hover{
opacity: 0.8;
transition: all ease 0.3s;
}
.blog-img{
width:100%;
max-height: 220px;
overflow:hidden;
}
.blog-img img{
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.blog-text{
display: flex;
flex-direction: column;
padding: 10px 3px;
}
.blog-text .category{
color: #ffffff;
text-transform: uppercase;
font-size: 0.8rem;
letter-spacing: 2px;
}
.blog-text strong{
font-size: 1.3rem;
color: #ffffff;
font-weight: 500;
margin: 5px 0px;
letter-spacing: 0.7px;
}
.blog-text .blog-post-time{
color: #9f9f9f;
font-size: 0.8rem;
letter-spacing: 1px;
}
/*==footer====================================*/
footer{
background-color: #0f1012;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 120px 0px 50px 0px;
}
.footer-container{
width: 100%;
max-width: 980px;
margin: auto;
}
.footer-heading h3,
.footer-heading h4{
color: #ffffff;
}
.footer-heading h3{
font-size: 5rem;
margin-top: 20px;
font-weight: 600;
}
.footer-heading h4{
font-size: 2rem;
font-weight: 600;
letter-spacing: 1px;
}
.footer-content{
display: flex;
justify-content: space-between;
margin-top: 100px;
}
.footer-box strong{
color: #ffffff;
font-size: 2rem;
text-transform: lowercase;
}
.footer-box ul{
margin-top: 15px;
}
.footer-box ul li a,
.footer-box ul li{
color: #ffffff;
font-size: 0.9rem;
text-transform: lowercase;
opacity: 0.9;
padding: 2px 0px;
transition: all ease 0.3s;
}
.footer-box ul li{
margin: 8px 0px;
}
.footer-box ul li:hover,
.footer-box ul li a:hover{
opacity: 0.6;
transition: all ease 0.3s;
}
.footer-bottom{
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 100px;
}
.footer-bottom-link{
display: flex;
justify-content: flex-start;
align-items: center;
}
.footer-bottom-link a,
.copyright span{
color: #78809e;
font-size: 0.9rem;
margin: 0px 10px;
transition: all ease 0.3s;
}
.footer-bottom-link a:hover{
opacity: 0.6;
transition: all ease 0.3s;
}
/*==scroll=progress==============================*/
#progress{
width: 50px;
height: 50px;
border-radius: 50%;
position: fixed;
bottom: 25px;
right: 25px;
box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
display: grid;
place-items: center;
z-index: 105;
}
#progress-value{
display: block;
height: calc(100% - 5px);
width: calc(100% - 5px);
background-color: #1c1f25;
border-radius: 50%;
display: grid;
place-items: center;
font-weight: 600;
font-size: 0px;
}
/*==making-blog-page-reponsive===========================*/
.menu-icon,
.menu-btn{
display: none;
}
@media(max-width:1250px){
.blog-heading h1{
font-size: 3rem;
line-height: 60px;
}
.page-container{
max-width: 100%;
width: 90%;
}
}
@media(max-width:1060px){
.footer-container{
max-width: 800px;
}
}
@media(max-width:850px){
.blog-container{
grid-template-columns: 1fr 1fr;
}
.footer-container{
width: 90%;
}
.footer-content{
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
}
.footer-box{
margin: 0px auto;
}
.footer-heading{
display: flex;
flex-direction: column;
justify-content: center;
}
}
@media(max-width:750px){
.navigation{
justify-content: space-between;
height: 65px;
padding: 35px 25px;
}
.logo{
font-size: 1.2rem;
}
.navigation .menu{
display: none;
position: absolute;
left: 0px;
top: 65px;
background-color: #14171c;
border-bottom: 1px solid #1c1f25;
width: 100%;
padding: 0px;
margin: 0px;
z-index: 100;
}
.navigation .menu li{
width:100%;
margin: 0px;
padding: 0px;
}
.navigation .menu li a{
width: 100%;
height: 40px;
display: flex;
align-items: center;
margin: 0px;
padding: 30px 20px;
border: 1px solid rgba(211,211,211,0.01);
}
.navigation .menu li a:hover{
color: #14171c;
background-color: #ffffff;
transition: all ease 0.3s;
opacity: 1;
}
.menu-icon{
display: block;
}
.navigation .menu-icon{
cursor: pointer;
float: right;
padding: 5px;
position: relative;
user-select: none;
z-index: 106;
}
.navigation .menu-icon .nav-icon{
background-color: #ffffff;
display: block;
position: relative;
height: 2px;
transition: background 0.2s ease-out;
width: 25px;
}
.navigation .menu-icon .nav-icon::before,
.navigation .menu-icon .nav-icon::after{
background-color: #ffffff;
content: '';
position: absolute;
height: 100%;
transition: all ease-out 0.2s;
width: 100%;
}
.navigation .menu-icon .nav-icon::before{
top: 5px;
}
.navigation .menu-icon .nav-icon::after{
top: -5px;
}
.navigation .menu-icon:checked ~ .menu-icon .nav-icon,
.navigation .menu-icon .nav-icon{
background-color: transparent;
}
.navigation .menu-btn:checked ~ .menu-icon .nav-icon::before{
transform: rotate(-45deg);
top: 0px;
}
.navigation .menu-btn:checked ~ .menu-icon .nav-icon::after{
transform: rotate(45deg);
top: 0px;
}
.navigation .menu-btn:checked ~ .menu{
display: block;
}
}
@media(max-width:680px){
.footer-heading h4{
font-size: 1.6rem;
line-height: 30px;
}
.footer-heading h3{
font-size: 2.3rem;
}
.footer-bottom{
flex-wrap: wrap;
justify-content:space-between;
align-items: center;
padding: 0px 20px;
}
}
@media(max-width:530px){
.blog-container{
grid-template-columns: 1fr;
}
.blog-heading h1{
font-size: 2rem;
line-height: 40px;
}
.blog-heading{
margin: 20px 0px;
}
.blog-filter{
flex-wrap: wrap;
}
.blog-filter li{
margin-top: 8px;
}
}
@media(max-width:340px){
.footer-content{
grid-template-columns: 1fr;
margin-top: 40px;
}
.footer-box{
margin: 0px;
}
.footer-box strong{
font-size: 1.5rem;
}
}
➤Blog Website JS Code is have given below.
/*--==Scroll-bar-script======================-*/
let scrollPercentage = () => {
let scrollProgress = document.getElementById("progress");
let progressValue = document.getElementById("progress-value");
let pos = document.documentElement.scrollTop;
let calcHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
let scrollValue = Math.round( pos * 100 / calcHeight);
scrollProgress.style.background = `conic-gradient(#e2d30c ${scrollValue}%, #2b2f38 ${scrollValue}%)`;
progressValue.textcontent = `${scrollValue}%`;
}
window.onscroll = scrollPercentage;
window.onload = scrollPercentage;
/*--==Post-Filter-Script=================================--*/
$(document).on('click','.blog-filter li', function(){
$(this).addClass('blog-filter-active').siblings().removeClass('blog-filter-active')
});
/*--filter------------------------*/
$(document).ready(function(){
$('.list').click(function(){
const value = $(this).attr('data-filter');
if(value == 'all'){
$('.blog-box').show('1000');
}
else{
$('.blog-box').not('.'+value).hide('1000');
$('.blog-box').filter('.'+value).show('1000');
}
});
});

Comments