cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <body>
  <div class = "container-fluid">
    <div class = "row">
    
   
        
        
    <div class = "col-md-6">
    <div class = "pos " id = "calculator">
      
   <p id = "screen">Hello</p>   
  <ul id = "buttons">
    <li></li>   
<li ><button class="btn  btn-lg btn-dark btn-shadow" id= "clear" >c</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(0)" id= "0" >0</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" id= "+" >+</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(1)" id= "1" >1</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(2)"id= "2" >2</button></td>
      <td></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(3)"id= "3" >3</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" id= "-" >-</button></li>      
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(4)"id= "4" >4</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(5)"id= "5" >5</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(6)"id= "6" >6</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" id= "*" >*</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(7)"id= "7" >7</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(8)"id= "8" >8</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" onclick="nums(9)"id= "9" >9</button></li>
<li ><button class="btn  btn-lg btn-dark btn-shadow" id= "/" >/</button></li>    
    
      </ul>
  <div class="clear"></div>
<button class="btn  btn-lg btn-dark btn-shadow" id= "equal" >=</button>
    </div>
  </div>


 <div class = "col-md-4" >
      <h1>Simple Calculator<h1>
    </div> 

</div>
</body>
  
            
          
!
            
              body {
  font-family: monospace;
  background-color: rgb(98,208,217);
  
}
h1 {
  margin-top: 100px;
  color:white;
  font-size: 48pt;
  text-align: center;
}
.pos {
  position: relative;
}

.btn-dark{
  background-color: gray;
  border: 5px solid white;
  color: white;
  margin-top: 20px;
}
.btn-dark:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border-color: white;
}

.btn-shadow {
  
  box-shadow:  ;
  
}

.btn-dark:active{
  background: white;
}



#calculator{
  width: 350px;
  background-image: url(http://i1155.photobucket.com/albums/p545/jlcampbell1/copper_zpskeee6o97.png);
  padding: 20px;
  border-radius: 10px;
  border: 10px solid white;
  margin: 50px;
}


#screen{
  background-color: gray;
  text-align: right;
  width: 293px;
  
  border: 5px solid white;
  
  color: white;
  margin-top: 20px;
  padding: 20px;
  border-radius: 10px;
  font-size: 20px;
  box-shadow: inset -2px -2px 10px  rgb(90,90,90);
 
}

#buttons{
  list-style-type: none; 
    display: inline-block;
    align-content: center;
    width: 293px;
    padding: 0px; 
    background-color: ;
}

#buttons li { 
    margin: 3px 3px 0px 0;
    padding: 1px;
    vertical-align: top;
    float: left;
    width: 70px;
    height: 70px;
    text-align: center; 
    background: ;
}


.clear { clear: both; }

#equal{
  width: 293px;
    text-align: center;
    
    margin-top: 10px;
  margin-bottom: 20px;
}
            
          
!
            
              var display = 1;
var count = 0;

function dudd(x,y){return y};
b =  dudd;


function nums(x) {
count = b(display,x);   document.getElementById("screen").innerHTML=x;
display = count;
}

document.getElementById("equal").onclick = function(){
document.getElementById("screen").innerHTML=count;}

document.getElementById("clear").onclick = function() {document.getElementById("screen").innerHTML=0;
display = 1;
count = 0;

function dudd(x,y){return y};
b =  dudd;};



document.getElementById("+").onclick = function(){
  b = function myfunction (x,y) {
    z = x+y;
    return z;
  };
  
}

document.getElementById("-").onclick = function(){
  b = function myfunction (x,y) {
    z = x-y;
    return z;
  };
  
}

document.getElementById("*").onclick = function(){
  b = function myfunction (x,y) {
    z = x*y;
    return z;
  };
  
}

document.getElementById("/").onclick = function(){
  b = function myfunction (x,y) {
    z = x/y;
    return z;
  };
  
}




            
          
!
999px
Loading ..................

Console