www.webdeveloper.com
Results 1 to 3 of 3

Thread: Make Buttons Same Size on Calculator

  1. #1
    Join Date
    Sep 2012
    Posts
    2

    Make Buttons Same Size on Calculator

    I have a calculator script on my website. I want to make all the buttons the same siz.
    Here is the calculator
    http://www.astarmathsandphysics.com/...alculator.html
    And here is the script

    <style>input {font-size: 134px;}</style>
    <FORM NAME="Calc">
    <TABLE BORDER=1>
    <TR>
    <TD>
    <INPUT TYPE="text" style="width:628px;height:100px" NAME="Input" Size="100">
    <br>
    </TD>
    </TR>
    <TR>
    <TD>
    <INPUT TYPE="button" NAME="one" VALUE=" 1 " OnClick="Calc.Input.value += '1'">
    <INPUT TYPE="button" NAME="two" VALUE=" 2 " OnCLick="Calc.Input.value += '2'">
    <INPUT TYPE="button" NAME="three" VALUE=" 3 " OnClick="Calc.Input.value += '3'">
    <INPUT TYPE="button" NAME="plus" VALUE=" + " OnClick="Calc.Input.value += ' + '">
    <br>
    <INPUT TYPE="button" NAME="four" VALUE=" 4 " OnClick="Calc.Input.value += '4'">
    <INPUT TYPE="button" NAME="five" VALUE=" 5 " OnCLick="Calc.Input.value += '5'">
    <INPUT TYPE="button" NAME="six" VALUE=" 6 " OnClick="Calc.Input.value += '6'">
    <INPUT TYPE="button" NAME="minus" VALUE=" - " OnClick="Calc.Input.value += ' - '">
    <br>
    <INPUT TYPE="button" NAME="seven" VALUE=" 7 " OnClick="Calc.Input.value += '7'">
    <INPUT TYPE="button" NAME="eight" VALUE=" 8 " OnCLick="Calc.Input.value += '8'">
    <INPUT TYPE="button" NAME="nine" VALUE=" 9 " OnClick="Calc.Input.value += '9'">
    <INPUT TYPE="button" NAME="times" VALUE=" x " OnClick="Calc.Input.value += ' * '">
    <br>
    <INPUT TYPE="button" NAME="clear" VALUE=" C " OnClick="Calc.Input.value = ''">
    <INPUT TYPE="button" NAME="zero" VALUE=" 0 " OnClick="Calc.Input.value += '0'">
    <INPUT TYPE="button" NAME="DoIt" VALUE=" = " OnClick="Calc.Input.value = eval(Calc.Input.value)">
    <INPUT TYPE="button" NAME="div" VALUE=" / " OnClick="Calc.Input.value += ' / '"></style>
    <br>
    </TD
    </TR>
    </TABLE>
    </FORM>

  2. #2
    Join Date
    Nov 2010
    Posts
    1,082
    Code:
    <style>input {
    width:24%;
    font-size: 134px;}
    </style>

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    Thanks that works and looks great.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles