Fading text using Bootstrap


Bootstrap is the simplest way to built different styles and workings of a website using simple classes. Here I created fade in and fade out texts using the bootstrap with a class item and coursel. By declaring these classes and applying bootstrap to the website creates a fading texts as below.


Live Preview:

 




Here you can see the fading text inside the box. Now i think that you get a proper understanding about the fading text and the bootstrap. In a similar way you can also create fading images or multiple images for your website. I created the image coursel in the code section of my website....


Here below I put the code of the fading text so you can copy that snippet and paste or edit as in your own way for your html webpage. Here CSS is also a major factor of the of fading text.


Code:

<html>
<head>
<title> code by cspsyco</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

 &nbsp;<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

<style>



.carousel.carousel-fade .item {

 -webkit-transition: opacity 0.5s ease-in-out;

 -moz-transition: opacity 0.5s ease-in-out;

 -ms-transition: opacity 0.5s ease-in-out;

 -o-transition: opacity 0.5s ease-in-out;

 transition: opacity 0.5s ease-in-out;

 opacity:0;

text-align:center;



}



.carousel.carousel-fade .active.item

 {

 opacity:1;





}



h2

{

padding:2%;

}

.box

{

background:url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtA7MKPGy4YcOOFHpLFQTViagL2ZnPH-_FcN61yIKLGeUihhTipgsjKjhk9knDhRz6scyNb6DMpBgFJcRttJ6YtMpkCPncgK3djC-ZhvKb6b-9wXpVqy8DZkmVuXbj8uNEz5I6J-5PGIE/s640/3352586-white-backgrounds.jpg");

height:150px;

border:1px solid black;

width:100%;

box-shadow:5px 5px lightgrey;

background-size:100%;

background-repeat: no-repeat;

}



.item

{

position: absolute;



}



</style>
</head>
<body>
<br />

<div class="box"><br>

<div class="row container">

<div class="col-md-8">

<div class="carousel slide carousel-fade" data-interval="3000" data-ride="carousel" id="carousel-example-generic">

<div align="center" class="carousel-inner">

<div align="center" class="item active" style="width: 100%;">

<h2 align="center">

C S Psyco: A classic Website</h2>

</div>

<div class="item" style="width: 100%;">

<h2>

The largest network of programming languages</h2>

</div>

<div align="center" class="item" style="width: 100%;">

<h2>

20k+ Viewers</h2>

</div>

</div>

</div>

</div>

</div>

</div>
</body>

</html>


Thank You and Stay Updated...

Comments

Post a Comment

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Introducing Cloudflare Pages ⚡