Create Transformation Text Shape Using HTML5


Introduction

This is a simple application for beginners that shows how to create a Text Transformation Shape using HTML5 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 Text Transformation Shape applications. CSS is the acronym for Cascading Style Sheet that is used for design. CSS defines how HTML elements are to be displayed. Canvas is an important tag of a HTML 5 that is used to show the image and text in a HTML 5 applications. I hope this article helps to develop a Text Transformation Shape using HTML 5 and CSS tools.

Step 1: Open Visual Studio.

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

new.gif

webapplication.gif

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

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

css.gif

html.gif

Step 3:
In this step we add a CSS file named color.css. In the CSS we set font-family, font-size, color of Text Transformation Shape. 

  • Right-click on the Solution Explorer.
  • Add-> Add New Item.
  • Add style sheet.
  • Set the name of the style sheet is a "color.css".  

css.gif

css2.gif

Code

body, p, td, textarea
{

  font-family: "Helvetica Neue";

  font-size: 10px;

  line-height: 10px;

  color:Blue;

   }

body
{

 padding: 20px;

}

 h1
{

       margin-bottom: 20px;

}

Step 4:
In this section we set a text style of a text transformation page. In <style> tag we define a height, width, font-size, border, margin of a text.

 

Code

 

 .Rotate
 {
  width
: 300px
    }

 .Rotate ul
 {
  list-style
: none;
  }

 .Rotate a
 {

  width: 100px;

  height: 60px;

  font-size: 32px;

  border: 1px #900 solid;

  margin: 0 40px 40px 0;

  text-align: center;

  padding-top: 40px;

  float:right;

  z-index: 1;

  position: relative;

  text-decoration: none;

  color:Red;

}      

Step 5:
In this section we set a mouse hover event that performs user click on text after that change a shape of text.

Code

.Rotate a:hover
{

  border: 1px #000 solid;

  background:#00FFFF;

  z-index: 2;

 -webkit-transform:scale(3);

 -moz-transform:scale(3);

 -o-transform:scale(3);

 }

Step 6:
Now in this section we define a text body of a text transformation page.

Code

<body bgcolor="#66ffcc">

  <h1>Button Rotation Developed by Tom</h1>

  <section class="Rotate">

  <ul>

  <li><a href="">C</a></li>

  <li><a href="">C#</a></li>

  <li><a href="">Java</a></li>

  <li><a href="">Php</a></li>

  <li><a href="">WCF</a></li>

  <li><a href="">WPF</a></li>

  <li><a href="">WFF</a></li>

  <li><a href="">LINQ</a></li>

  </ul>

  <div style="clear: both;"></div>

  </section>

</body>


body.gif

Step 7:
The demo of a text transformation code is given below.

Code

<html>

 <head>

 <title>Tom application</title>
 <link href="demo.css" rel="stylesheet" type="text/css"
/>

<style>

.Rotate
 {
  width
: 300px
    }

 .Rotate ul
 {
  list-style
: none;
  }

 .Rotate a
 {

  width: 100px;

  height: 60px;

  font-size: 32px;

  border: 1px #900 solid;

  margin: 0 40px 40px 0;

  text-align: center;

  padding-top: 40px;

  float:right;

  z-index: 1;

  position: relative;

  text-decoration: none;

  color:Red;

}     

.Rotate a:hover
{

  border: 1px #000 solid;

  background:#00FFFF;

  z-index: 2;

 -webkit-transform:scale(3);

 -moz-transform:scale(3);

 -o-transform:scale(3);

 }
  </style>
 </head>
</html>

Step 8:
Press Ctrl + F5 to run the application in a browser.

Output

out.gif

out1.gif

out2.gif

out3.gif


Resources

Here is some useful resources:

Up Next
    Ebook Download
    View all
    Learn
    View all