Click here to Skip to main content
15,891,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<!DOCTYPE html>
<html>
<body>
<div class="border">
<ol>
    <li class="nostyle">
        <input type="number" name="input"  style="width:120px; class="left"">
   </li>
<br>
    <li class="nostyle">
<div id="button">
      <input type="button" value="1" class="left" />
      <input type="button" value="2"/ >
      <input type="button" value="3" " />
      <input type="button" value="+" />
</div>
    </li>

 <li class="nostyle">
<div class="button" >
      <input type="button" value="4" class="left" />
      <input type="button" value="5" />
      <input type="button" value="6" />
      <input type="button" value="-" />
</div>
    </li>

<li class="nostyle">
<div class="button" >
      <input type="button" value="7" class="left" />
      <input type="button" value="8"  />
      <input type="button" value="9"  />
      <input type="button" value="*" />
</div>
</li>

 <li class="nostyle">
<div class="button" >
      <input type="button" value="0" class="left"  />
      <input type="button" value="%" />
      <input type="button" value="="  />
      <input type="button" value="/" />
    </li>
    </ol>
</div>
<style type="text/css" media="all">
li.nostyle {
    list-style-type: none;
}
.border
{
width:200px;
height:250px;
border:1px solid grey;
}
.left
{

left: 10px;
width: 30px;
}
.button{
 display: block;
  margin:5px;
 text-align: center;
 float:left;
      }
</style>
</body>
</html>
Posted

You have problem in your CSS

try this link
 
Share this answer
 
Where to begin? There's at least half a dozen problems with this:

1. You have a missing <head> section
2. The CSS should be placed in the <head> section
3. You have a misplaced quote in the 'input' tag
4. The first row of buttons has the 'id' set to 'button' instead of the class.
5. There is a missing </div> tag from the last row of buttons
6. You have a <br /> tag nested within an ol element

And I could go on...

Solution:

HTML
<html>

<head>
   <title></title>

   <style type="text/css">
        li.nostyle 
        {
            list-style-type: none;
        }
        .border
        {
            width:200px;
            height:250px;
            border:1px solid grey;
        }
        .left
        {
            left: 10px;
            width: 30px;
        }
        .button
        {
            width:200px;
            float:left;
        }
        .otherButton
        {
            width:15px;
        }
    </style>

</head>

<body>

    <div class="border">
        <ol>
            <li class="nostyle">
                <div class="button">
	                <input type="text" name="input" style="width:120px;" class="left" />
		</div>

	    </li>

            <li class="nostyle">
                <div class="button">
                    <input type="button" value="1" class="left" />
                    <input type="button" value="2" class="otherButton"/>
                    <input type="button" value="3" class="otherButton"/>
                    <input type="button" value="+" class="otherButton"/>
                </div>
            </li>
 
            <li class="nostyle">
                <div class="button">
                    <input type="button" value="4" class="left" />
                    <input type="button" value="5" class="otherButton"/>
                    <input type="button" value="6" class="otherButton"/>
                    <input type="button" value="-" class="otherButton"/>
                </div>
             </li>
 
            <li class="nostyle">
                <div class="button">
                    <input type="button" value="7" class="left" />
                    <input type="button" value="8" class="otherButton"/>
                    <input type="button" value="9" class="otherButton"/>
                    <input type="button" value="*" class="otherButton"/>
                </div>
            </li>
 
            <li class="nostyle">
                <div class="button">
                    <input type="button" value="0" class="left"  />
                    <input type="button" value="%" class="otherButton"/>
                    <input type="button" value="=" class="otherButton"/>
                    <input type="button" value="/" class="otherButton"/>
                </div>
            </li>
        </ol>
    </div>

</body>

</html>
 
Share this answer
 
v6
Add align="" css property in your css claas
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900