1. First, we need fresh reactjs setup, and for that, we need to run below commands into out terminal, and also we should have latest node version installed on our system:
npx create-react-app my-awesome-project
cd my-awesome-project
npm start
2. Now we need to run below commands into our project terminal to get bootstrap and related modules into our reactjs application:
npm install [email protected] --save
npm start //For start project again
3. Finally for the main output, we need to add below code into our my-awesome-project/src/App.js file or if you have fresh setup then you can replace my-awesome-project/src/App.js file code with below code:
import React from 'react';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
function App() {
return (
<div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css" integrity="sha256-2XFplPlrFClt0bIdPgpz8H7ojnk10H69xRqd9+uTShA=" crossorigin="anonymous" />
<section>
<div class="container">
<div class="text-center mb-5">
<h5 class="text-primary h6">Our Blog</h5>
<h2 class="display-20 display-md-18 display-lg-16">Most recent our blog</h2>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 mb-2-6">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/6A5ACD/000000" alt="..."/>
<div class="date"><span>15</span>Sep</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">Loft therapy taking care of your home</a></h3>
<p class="display-30">Loft therapy will be a thing of the past and here's why.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Brittany Hucks</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>26</span></a></li>
</ul>
</div>
</article>
</div>
<div class="col-lg-4 col-md-6 mb-2-6">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/FFB6C1/000000" alt="..."/>
<div class="date"><span>18</span>Aug</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">All you need to know about cleaning</a></h3>
<p class="display-30">Five common mistakes everyone makes in about cleaning.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Mark Abell</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>28</span></a></li>
</ul>
</div>
</article>
</div>
<div class="col-lg-4 col-md-6 mb-2-6">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/008080/000000" alt="..."/>
<div class="date"><span>24</span>May</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">This cleaning tips will haunt you forever</a></h3>
<p class="display-30">Seven difficult things you should know about haunt.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Curtis Chester</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>18</span></a></li>
</ul>
</div>
</article>
</div>
<div class="col-lg-4 col-md-6 mb-2-6 mb-lg-0">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/EE82EE/000000" alt="..."/>
<div class="date"><span>09</span>May</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">Five things to know about cleaning service office</a></h3>
<p class="display-30">Seven difficult things you should know about haunt.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Kathleen</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>24</span></a></li>
</ul>
</div>
</article>
</div>
<div class="col-lg-4 col-md-6 mb-2-6 mb-md-0">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/4682B4/000000" alt="..."/>
<div class="date"><span>14</span>Apr</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">Seven difficult things about cleaning service like</a></h3>
<p class="display-30">Seven difficult things you should know about haunt.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Admin</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>09</span></a></li>
</ul>
</div>
</article>
</div>
<div class="col-lg-4 col-md-6">
<article class="card card-style2">
<div class="card-img">
<img class="rounded-top" src="https://www.bootdey.com/image/350x280/87CEEB/000000" alt="..."/>
<div class="date"><span>26</span>Mar</div>
</div>
<div class="card-body">
<h3 class="h5"><a href="#!">The hidden agenda of window cleaning concept</a></h3>
<p class="display-30">Seven difficult things you should know about haunt.</p>
<a href="#!" class="read-more">read more</a>
</div>
<div class="card-footer">
<ul>
<li><a href="#!"><i class="fas fa-user"></i>Vickie</a></li>
<li><a href="#!"><i class="far fa-comment-dots"></i><span>11</span></a></li>
</ul>
</div>
</article>
</div>
</div>
</div>
</section>
</div>
);
}
export default App;
4. Now we need to add below code into our my-awesome-project/src/App.css file :
body{margin-top:20px;}
.card-style2 {
position: relative;
display: flex;
transition: all 300ms ease;
border: 1px solid rgba(0, 0, 0, 0.09);
padding: 0;
height: 100%;
}
.card-style2 .card-img {
position: relative;
display: block;
background: #ffffff;
overflow: hidden;
border-radius: 0.25rem;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.card-style2 .card-img img {
transition: all 0.3s linear 0s;
}
.card-style2:hover .card-img img {
transform: scale(1.05);
}
.card-style2 .date {
position: absolute;
right: 30px;
top: 30px;
z-index: 1;
color: #16bae1;
overflow: hidden;
padding-bottom: 10px;
line-height: 24px;
text-align: center;
border: 2px solid #ededed;
display: inline-block;
background-color: #ffffff;
text-transform: uppercase;
border-radius: 0.25rem;
}
.card-style2 .date span {
position: relative;
color: #ffffff;
font-weight: 500;
font-size: 20px;
display: block;
text-align: center;
padding: 12px;
margin-bottom: 10px;
background-color: #00baee;
border-radius: 0.25rem;
}
.card-style2 .card-body {
position: relative;
display: block;
background: #ffffff;
padding: 2rem;
}
.card-style2 .card-body h3 {
margin-bottom: 0.8rem;
}
.card-style2 .card-body h3 a {
color: #004975;
}
.card-style2 .card-body h3 a:hover {
color: #00baee;
}
.card-style2 .card-footer {
border-top: 1px solid rgba(0, 0, 0, 0.09);
background: transparent;
padding-right: 2rem;
padding-left: 2rem;
-ms-flex-align: end;
align-items: flex-end;
}
.card-style2 .card-footer ul {
display: flex;
justify-content: space-between;
list-style: none;
margin-bottom: 0;
}
.card-style2 .card-footer ul li {
font-size: 15px;
}
.card-style2 .card-footer ul li a {
color: #394952;
}
.card-style2 .card-footer ul li a:hover {
color: #00baee;
}
.card-style2 .card-footer ul li i {
color: #00baee;
font-size: 14px;
margin-right: 8px;
}