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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <div class="dialogo">
  <p class="mensaje">His audiam deserunt in, eum ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim alterum qui cu. Accusamus consulatu ius te, cu decore soleat appareat usu.</p>
  <div class="botones">
    <button class="botonAceptar">Aceptar</button>
    <button class="botonCancelar">Cancelar</button>
  </div>
</div>
            
          
!
            
              // Variables
@okColor: #3c3;
@errorColor: #f22;
@anchoBotones: 120px; //@anchoBotones: 70px;

// Mixins
.contenedor(@colorBorde; @colorFondo) {
  border: 2px solid darken(@colorBorde, 40%);
  border-radius: 5px;
  width: 50%;
  margin: 50px auto;
  padding: 10px 20px;
  background: @colorFondo;
  .mensaje {
    text-align: center;
    color: #aaa;
  }
}


// Contenedor con botones de confirmacion
.contenedor(@colorBorde; @colorFondo; @tipo) when (@tipo = confirmacion) {
  .contenedor(@colorBorde; @colorFondo);
  .botones {
    text-align: center;
    margin: 30px auto 10px;
  }
}

// Contenedor sin botones de confirmacion
.contenedor(@colorBorde; @colorFondo; @tipo) when not (@tipo = confirmacion) {
  .contenedor(@colorBorde; @colorFondo);
  .botones {
    display: none;
  }
}

.boton(@color; @ancho: 100px) {
  margin: 5px;
  width: @ancho;
  // Si el ancho del boton es mayor de 100px se le aplica el padding 
  & when (@ancho > 100px) {
    padding: 10px 20px;
  }
  
  & when (@ancho < 100px) {
    padding: 5px 10px;
  }
  
  border-radius: 5px;
  background: linear-gradient(@color, darken(@color, 40%));
  color: contrast(darken(@color, 40%));
  border: 2px solid darken(@color, 40%);
  
  &:hover {
    background: linear-gradient(45deg, @color, darken(@color, 40%));
  }
}


// Estilos finales
body {
  background: rgb(29, 31, 32);  
}

.dialogo {
  //.contenedor(@errorColor; #111; aviso);
  .contenedor(@errorColor; #111; confirmacion);
  
  .botonAceptar {
    .boton(@okColor; @anchoBotones);
  }

  .botonCancelar {
    .boton(@errorColor; @anchoBotones);
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console