Category: css

How to blink text in html using css

How to blink text in HTML using CSS ?

How to blink text in HTML using CSS:-  Hi Readers, In this blog I will demonstrate to you that how we can blink text in HTML using CSS.

Some days before we can blink text in HTML using <blink> tag of HTML, Now these option has been depreciated but no need to worry. We can do the same thing by using CSS code :).

Css Code for Blink text

<style>
.blink {
  animation: blink-animation 1s steps(5, start) infinite;
  -webkit-animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
@-webkit-keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
</style>

Just Copy this code and paste the code after <head> in HTML code

HTML Code to blink Text :-

<!doctype html>

<html>
<head>
<title>  blink text  html using css</title>
<style>
.blink {
  animation: blink-animation 1s steps(5, start) infinite;
  -webkit-animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
@-webkit-keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
</style>
</head>
<body>
<p class="blink">I want to blink this text</p>
</body>

</html>

Now after executing this code in the browser.The text will start blinking on user’s browser screen.

You can blink so many texts in HTML using CSS code, which I have explained you below this line.

<html>
<head>
<title>  blink text  html using css</title>
<style>
.blink {
  animation: blink-animation 1s steps(5, start) infinite;
  -webkit-animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
@-webkit-keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
</style>
</head>
<body>
<p class="blink">I want to blink this text</p>


<h1 class="blink">I want to blink this text</h1>

<span class="blink">I want to blink this text</span>


</body>

</html>

I hope you would like this post ” How to blink text in HTML using CSS” and also comment your feedback and problem if any come.

 

Feedback

I hope you enjoyed this post about  How to blink text in HTML using CSS and provide your valuable feedback and share your problem in Technical Forum.

Popup image on page load

Popup image on page load: –In this blog, We will explain to you how you can show popup image on page load on any browser with a cancel button at the top.To Popup image on page load, you should have basic knowledge of HTML & CSS

HTML Code popup image on page load:-

Firs, create a folder with a popup and then create a new file inside popup folder, copy the following code in the open file and save it as an extension of a .html file.I have explained an essential part of the code with the help of mentioned comments in below code.

<html>

<head>

    <title>Popup image on page load</title>
 
    <style> 
  //put css code which i have mentioned below
    </style>
</head>
<body>
 <!-- div popup code starts from here -->
<div id="popup">

    <!-- and here comes the image -->
    <img src="Coming-Soon-Project-exatlas-e1429813652836.jpg" alt="popup">

        <!-- This button will close the popup on website-->
        <button id="close">Close button</button>

        <!--  we close the div popup code-->
        <!-- all things in this will show up within the popup so you can add more things not just an image -->
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script>
// write your javascript code here

</script>

</body>
</html>

CSS Code for Popup image on page load:-

This Stylesheet code copy from here paste on an HTML file by replacing following code

  //put css code which i have mentioned below
<style> 
    #popup {
            display:none;
            position:absolute;
            margin:0 auto;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 9999;
    }
    </style>

JavaScript Code:-

<script>
// below code line means when page loads on browser then run the following script
$(document).ready(function () {

    //select the POPUP DIV and show it
    $("#popup").hide().fadeIn(1000);

    //close the POPUP buuton  if the button with id="close" is clicked
    $("#close").on("click", function (e) {
        e.preventDefault();
        $("#popup").fadeOut(1000);
    });

});
</script>

 

Full source code

<html>

<head>

    <title>Popup image </title>
 
    <style>


    #popup {
            display:none;
            position:absolute;
            margin:0 auto;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 9999;
    }
    </style>

     </head> <body>  <!-- div popup code starts from here --> 
<div id="popup">    
 <!-- and here comes the image -->  
   <img src="https://i1.wp.com/techieflair.com/wp-content/uploads/2017/05/popup.jpg" alt="popup">    
     <!-- This button will close the popup on website-->       
  <button id="close">Close button</button>        
 <!--  we close the div popup code-->        
 <!-- all things in this will show up within the popup so you can add more 
things not just an image --> </div>

 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> 
<script>

// below code line means when page loads on browser then run the following script
$(document).ready(function () {

    //select the POPUP DIV and show it
    $("#popup").hide().fadeIn(1000);

    //close the POPUP buuton  if the button with id="close" is clicked
    $("#close").on("click", function (e) {
        e.preventDefault();
        $("#popup").fadeOut(1000);
    });

});
</script>

    
</body> </html>

Snapshot

Popup image on page load
Popup image on page load

I hope you would like this post and if you have any problem/suggestion/feedback then please give us by commenting below

Responsive four column div

Responsive four column div

Responsive four column div:- Hi Readers, Through this article you can make a responsible four div column layout in HTML using CSS. Four column will be responsive in all media screen. A user can use this layout to show services and other section of the website.

CSS For Responsive four column div

First of all create a css file with name style.css and copy below code to make responsive four column div

.maincontainer {

width: 100%; height: 75px; border: 3px solid yellow; padding:0px; }

.floating-box1 { display: inline-block; width: 24.8%; height: 75px; border: 1px solid black; padding:0px; float:left; }

.floating-box2 { display: inline-block; width: 24.8%; height: 75px; border: 1px solid black; padding:0px; float:left; }

.floating-box3 { display: inline-block; width: 24.8%; height: 75px; border: 1px solid black; padding:0px; float:left; }

.floating-box4 { display: inline-block; width: 24.8%; height: 75px; border: 1px solid black; padding:0px; float:left; }

@media only screen and (max-width:320px) {

.maincontainer { float:none; width:100%; height:auto; }

.floating-box1 { float:none; width:100%; }

.floating-box2 { float:none; width:100%; }

.floating-box3 { float:none; width:100%; }

.floating-box4 { float:none; width:100%;

}

Create HTML Page

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
 
 <!---main container--->
 <div class="maincontainer">
 
 <!----container 1---->
 
 <div class="floating-box1">
 
 
 <p>Hi Readers, Through this article you can make a responsible four div column layout in HTML using CSS. Four column will be responsive in all media screen. A user can use this layout to show services and other section of the website.</p>
 
 </div>
 
 
 
 <!----container2---->
 
 <div class="floating-box2">
 
 
 <p>Hi Readers, Through this article you can make a responsible four div column layout in HTML using CSS. Four column will be responsive in all media screen. A user can use this layout to show services and other section of the website.</p>
 
 </div>
 
 <!----container3---->
 
 <div class="floating-box3">
 
 <p>Hi Readers, Through this article you can make a responsible four div column layout in HTML using CSS. Four column will be responsive in all media screen. A user can use this layout to show services and other section of the website.</p>
 
 </div>
 
 
 <!----container4---->
 
 <div class="floating-box4">
 
 <p>Hi Readers, Through this article you can make a responsible four div column layout in HTML using CSS. Four column will be responsive in all media screen. A user can use this layout to show services and other section of the website.</p>
 
 </div>
 
 
 
 
 
 </div>
</body>
<html>

Output

onebox  twobox threebox fourbox

Here we ends session .

Blink text CSS

Blink text CSS

Blink text CSS: –Hi Readers, Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn’t need to worry we can blink text in  css HTML .

CSS Code

Below we have created an animation property of CSS to blink and used class .blink

.blink {
animation: blink-animation 1s steps(5, start) infinite;
-webkit-animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
to {
visibility: hidden;
}
}
@-webkit-keyframes blink-animation {
to {
visibility: hidden;
}
}


WHOLE Code:-

Now copy code and run file on browser and you will get text blinking

<html xmlns="http://www.w3.org/1999/xhtml">

<head ><title> Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn't need to worry we can blink text in HTML using CSS.</title>

<style>
 .blink {
 animation: blink-animation 1s steps(5, start) infinite;
 -webkit-animation: blink-animation 1s steps(5, start) infinite;
 }
 @keyframes blink-animation {
 to {
 visibility: hidden;
 }
 }
 @-webkit-keyframes blink-animation {
 to {
 visibility: hidden;
 }
 }
 </style>

</head>

<body>
 
<p class="blink">Hi Readers, Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn't need to worry we can blink text in HTML using CSS.</p>
<p class="blink">Hi Readers, Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn't need to worry we can blink text in HTML using CSS.</p>
<p class="blink">Hi Readers, Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn't need to worry we can blink text in HTML using CSS.</p>
 </body>

</html>

 Hi Readers, Blink element is used to blink or highlight text on the website. In older days we use HTML <blink> tag to blink text in HTML easily but now these option has been depreciated but doesn’t need to worry we can blink text in HTML using CSS.