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>
<div class="container bootstrap snippets bootdey">
<div class="row">
<div class="col-md-5">
<div class="alert alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-info alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-success alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-warning alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-danger alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
</div>
<div class="col-md-5">
<div class="alert alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-info alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-success alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-warning alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
<div class="alert alert-danger alert-coupon">
<h4>Special Offer from JES and Ice-O-Matic</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos a similique dicta modi minus nostrum magnam provident reprehenderit in quae.</p>
</div>
</div>
</div>
</div>
</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;}
body {
padding: 50px;
}
.alert-coupon {
border: 1px dashed;
h1, h2, h3, h4, h5, h6 {
font-size: 20px;
line-height: 1.5;
text-align: center;
}
p:last-child {
margin-bottom: 0;
}
}