1. Home
  2. Computing & Technology
  3. JavaScript

Calculator Tutorial

8. Stylesheet

clr gif

The next step in creating our calculator now that we have a form that can perform the necessary calculations is to alter the appearance of the form to make it look more like a calculator.

To do this let's create a stylesheet with some entries in it that we can apply to the table that contains our calculator. What I use to create the yellow background and thin black outline of my calculators is the following stylesheet entries:

.tc {margin:5px; border:solid #000000 1px;
background-color:#ffffcc;}

If we save this as easter.css we can then link it into our page by adding the following code to the head of our page:

<link rel="stylesheet" href="easter.css" type="text/css" />

The final step is to apply the stylesheet to our form and add the description of what the calculator is.

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Explore JavaScript

More from About.com

  1. Home
  2. Computing & Technology
  3. JavaScript

©2008 About.com, a part of The New York Times Company.

All rights reserved.