Create Glowing Text Using HTML 5


Introduction

This is a simple application for beginners that shows how to make a text glow on a mouse over event using HTML 5 and CSS tools. We know that HTML 5 is the advanced version of HTML. Basically HTML 5 can be used to develop 3D applications. This article is intended to help with the use of HTML5 tools to develop a Text glow on a mouse over event. CSS is the acronym for Cascading Style Sheet that is used for design. CSS defines how HTML elements are to be displayed. I hope this article helps to understand how to make an application with text that glows on a mouse over event using a CSS3 and HTML 5 tools.

Step 1 : First Open a HTML editor such as Notepad.

  • Open start->Notepad.
  • The name of editor is "Glory".

notepad.gif

Step 2 :
Create a Folder on a desktop.

  • Right-click on desktop->new->Folder.
  • Name of folder is "Text".

folder.gif

Step 3:
Open Visual Studio.

  • Go to file -> New->Projects.
  • Crete an ASP. NET Web Application.
  • Name of "TextGlory.aspx".

new application.gif

openapplication.gif

Step 4 :
Add a HTML file to your web application.

  • Right-click on Solution Explorer.
  • Add->add new item->HTML form.
  • The Name of the HTML form is "Html.html".

addhtml.gif

html.gif

Step 5 :
 In this step we define the body part of a title.

Code

<body>
    <div class="text-glow">
        <a href="#">
           <h1>MCN Solution</h1>
           <h1>MCN professional</h1>
           <h1>CsharpCorner</h1>
        </a>
    </div>
</body>

1.gif

Step 6 :
In the css file we define the Text Glow class that sets the all properties on the font; that is font family, font size and color of a font.

Code

.text-glow
{
    font-size:4em;
    color:Green;
    font-family:Arial;
}

Step 7 : Now in this step we define a hover, focus and active attributes of a text glow class.

Code

.text-glow:hover,
.text-glow:focus
.text-glow:active
{
ctx-stroke-width: 5.3px;
ctx-stroke-color: Green;
ctx-fill-color: Green;
text-shadow: 1px 0px 20px Red;
ctx-transition: width 0.3s;
transition: width 0.3s;
moz-transition: width 0.3s;
o-transition: width 0.3s;
}

Step 8 :  In the above step we define a hover, focus and active attributes of a text glow class. Now in hte second phase we define link attributes.

Code 

 .text-glow a
{
    ctx-transition: all 0.3s ease-in;
    ctx-transition: all 0.3s ease-in;
    M-transition: all 0.3s ease-in;
    O-transition: all 0.3s ease-in;
    text-decoration:none;
    color:white;
}

Step 9 : This step we set the transition effect, which is very popular with CSS3 designers. To implement this effect on your page simply set the div class and add an href tag around the text that you want to link and glow.

Code

<body
>
 <div class="text-glow">
   <a href="#">
    </a>
  </div>
</body>

Step 10 : The complete code of a text glow application is given below.

Code

<
html>
<
header>
<
style>
.text-glow
{
    font-size:4em;
    color:Green;
    font-family:Arial;
}
.text-glow:hover,
.text-glow:focus
.text-glow:active
{
ctx-stroke-width: 5.3px;
ctx-stroke-color: Green;
ctx-fill-color: Green;
text-shadow: 1px 0px 20px Red;
ctx-transition: width 0.3s;
transition: width 0.3s;
moz-transition: width 0.3s;
o-transition: width 0.3s;
.text-glow a
{
 ctx-transition: all 0.3s ease-in;
 ctx-transition: all 0.3s ease-in;
 M-transition: all 0.3s ease-in;
 O-transition: all 0.3s ease-in;
 text-decoration:none;
 color:white;
}
body
{
    background-color: #000000;
}
</style>
</
head>
<
body>
  <div class="text-glow">
    <a href="#">
     <h1>MCN Solution</h1>
      <h1>MCN professional</h1>
     <h1>CsharpCorner</h1>
    </a>
  </div>
</body>

Step 11 : Press ctrl+f5 run application on a browser.

Output

 output.gif

 Clipboard06.gif

Resources

Here is some useful resources:

Up Next
    Ebook Download
    View all
    Learn
    View all