123

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <link rel="stylesheet" href="calc.css">
    <title>Calculadora</title>
  </head>
  <body onload="init();">
  <div class="contenedor-primario"></div>
  <div class="contenedor-principal">
  <FORM NAME="Calc">
    <div class="container-fluid contenedor">

      <div class="row resultado2">

        <div class="col operaciones">
          <INPUT TYPE="text" class="form-control-plaintext operacion" NAME="Input" Size="16" disabled>
          <INPUT TYPE="text" class="form-control-plaintext resultado" NAME="Input2" Size="16" disabled>
        </div>

      </div>

    </div>
    <div class="container-fluid contenedor2">
      <div class="row num">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  7  " OnClick="Calc.Input.value += '7'">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  8  " OnClick="Calc.Input.value += '8'">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  9  " OnClick="Calc.Input.value += '9'">
      </div>
      <div class="row num">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  4  " OnClick="Calc.Input.value += '4'">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  5  " OnClick="Calc.Input.value += '5'">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  6  " OnClick="Calc.Input.value += '6'">
      </div>
      <div class="row num">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  1  " OnClick="Calc.Input.value += '1'">
        <INPUT TYPE="button" NAME="two" class="col col-background buttons" VALUE="  2  " OnClick="Calc.Input.value += '2'">
        <INPUT TYPE="button" NAME="three" class="col col-background buttons" VALUE="  3  " OnClick="Calc.Input.value += '3'">
      </div>
      <div class="row num">
        <INPUT TYPE="button" NAME="point" class="col col-background buttons" VALUE="  .  " OnClick="Calc.Input.value += '.'">
        <INPUT TYPE="button" NAME="one" class="col col-background buttons" VALUE="  0  " OnClick="Calc.Input.value += '0'">
        <INPUT TYPE="button" NAME="DoIt" class="col col-background buttons" VALUE="  =  " OnClick="calcular();">
      </div>
    </div>
    <div class="container-fluid contenedor3">
      <div class="row num num2">
        <INPUT TYPE="button" NAME="clear" class="col colgris buttons grisclaro2" VALUE="  C  " OnClick="Calc.Input.value = ''; Calc.Input2.value = ''">
      </div>
      <div class="row num num2">
        <INPUT TYPE="button" NAME="div" class="col colgris buttons grisclaro2" VALUE="  ÷  " OnClick="Calc.Input.value += '/'">
      </div>
      <div class="row num num2">
        <INPUT TYPE="button" NAME="times" class="col colgris buttons grisclaro2" VALUE="  ×  " OnClick="Calc.Input.value += '*'">
      </div>
      <div class="row num num2">
      <INPUT TYPE="button" NAME="minus" class="col colgris buttons grisclaro2" VALUE="  -  " OnClick="Calc.Input.value += '-'">
      </div>
      <div class="row num num2">
        <INPUT TYPE="button" NAME="plus" class="col colgris buttons grisclaro2" VALUE="  +  " OnClick="Calc.Input.value += '+'">
      </div>
    </div>
  </FORM>
  </div>
  <div class="contenedor-secundario"></div>
<script src="calc2.js"></script>
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
  </body>
</html>
            
          
!
            
              * {
  margin:0;
  padding:0;
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
}
html {
  height:100%;
  width:100%;
}
body {
    height:100%;
    width:100%;
    background-color: #3C4043
}
.contenedor-primario {
  width: 35%;
  height: 100%;
  float: left;
  background-color: black;
}
.contenedor-principal {
  width: 30%;
  height: 100%;
  float: left;
}
.contenedor-secundario {
  width: 35%;
  height: 100%;
  float: left;
  background-color: black;
}
@media (max-width: 767.98px) {
  .contenedor-primario {
    display: none;
  }
  .contenedor-secundario {
    display: none;
  }
.contenedor-principal {
  width: 100%;
}
}
.contenedor {
  height: 40%;
  width: 100%;
  position: relative;
  background-color: white;
}
.contenedor2 {
  height: 60%;
  width: 78%!important;
  position: relative;
  background-color: #3C4043;
  float: left;
}
.contenedor3 {
  height: 60%;
  width: 22%!important;
  position: relative;
  background-color: #5D6166;
  float: left;
}
.col {
  background-color: #3C4043;
  cursor: pointer;
}
.col h1 {
  text-align: center;
  position: relative;
  top: 50%;
  -ms-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  color:white;
  font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, "sans-serif";
}
.col-background:active {
    background-color: #606466;
    -moz-border-radius: 700px;
   -webkit-border-radius: 700px;
   border-radius: 700px;
    -webkit-transition: background-color 10ms linear;
    -moz-transition: background-color 10ms linear;
    -o-transition: background-color 10ms linear;
    -ms-transition: background-color 10ms linear;
    transition: background-color 10ms linear;
}
.grisclaro {
  background-color: #5D6166;
}
.grisclaro2 {
  background-color: #5D6166;
  width: 100%;
  height: 100%;
}
.grisclaro2:active {
    background-color: #7D8084;
    -moz-border-radius: 700px;
   -webkit-border-radius: 700px;
   border-radius: 700px;
    -webkit-transition: background-color 10ms linear;
    -moz-transition: background-color 10ms linear;
    -o-transition: background-color 10ms linear;
    -ms-transition: background-color 10ms linear;
    transition: background-color 10ms linear;
}
.colgris {
  background-color: #5D6166;
}
.col {
  padding-left: 0!important;
  padding-right: 0!important;
}
.num {
  height: 25%;
}
.num2 {
  height: 20%;
}
.resultado {
  text-align: right;
  position: absolute;
  color:#5D6166;
  bottom:5%;
  font-size: 40px;
}
.operacion {
  text-align: right;
  position: absolute;
  bottom:25%;
  color:black;
  font-size: 60px;
}
.operacionesinvisibles {
  display:none;
}
.resultado2 {
  width: 100%;
  height: 100%;
  color:white!important;
}
.resultado2 .col {
  background-color: white!important;
}
.resultado2 .col h1 {
  color:black;
}
.operaciones {
  cursor:auto;
}
#mioperacionaresolver {
  float:right!important;
}
#resultado2 {
  float:right!important;
  left:100%;
  right:0;
  margin-left:100%;
}
form {
  height:100%;
}
.buttons{
  border:none;
  outline:none;
  text-align: center;
  position: relative;
  top: 50%;
  -ms-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  color:white;
  font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, "sans-serif";
  font-size:2.7rem;
}
*:focus {
    outline: 0 !important;
}
            
          
!
            
              function calcular(){
      Calc.Input2.value = eval(Calc.Input.value);
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console