Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container ">
  <div class="row">
    <h3>Usando divs</h3>
  </div>
  <div class="wrapper" style="border:1px solid gray;">
    <div class="box">
      <div class="card card-price">
        <div class="card-img">
          <a href="#">
            <img alt="una forma" src="https://cdn.pixabay.com/photo/2013/07/27/05/13/lighthouse-168132_1280.jpg" class="img-responsive">
        <div class="card-caption">
          <span class="h2">A</span>
            <p>Lorem ipsum dolor, sit amet cing elit. Vero quas ipsam</p>
         </div>
          </a>
        </div>
      </div>
    </div>
    <div class="box-wrap">
      <div class="box">
        <div class="card card-price">
          <div class="card-img">
            <a href="#">
          <img alt="una forma" src="https://www.viajejet.com/wp-content/viajes/paisaje-marino-lago-jackson.jpg" class="img-responsive">
      <div class="card-caption">
        <span class="h2">B</span>
        <p>Lorem ipsum dolor, sit amet consect ratione ipsam</p>
      </div>
    </a>
          </div>
        </div>
      </div>
      <div class="box">
        <div class="card card-price">
          <div class="card-img">
            <a href="#">
               <img alt="una forma" src="https://www.viajejet.com/wp-content/viajes/paisaje-marino-lago-jackson.jpg" class="img-responsive">
      <div class="card-caption">
        <span class="h2">C</span>
        <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Vero quas, ratione ipsam</p>
      </div>
    </a>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!--Figure-->
  <div class="row">
    <h3>Usando Figure</h3>
  </div>
  <div class="row" style="border:1px solid gray; padding: 20px;">
    <div class="col-md-6 col-xs-12">
      <figure>
        <img class="tarjeta" src="https://i.blogs.es/264eda/cuma-cevik-landscapes-12-/1366_2000.jpg" alt="Elephant at sunset">
        <figcaption>
          <h2 class="val">Lorem Ipsum</h2>
          <p class="desc">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.</p>
        </figcaption>
      </figure>
    </div>
    <div class="col-md-6 col-xs-12">
      <figure>
        <img class="child_tarjeta" src="https://cdn.pixabay.com/photo/2020/05/22/14/04/landscape-5205518_1280.jpg" alt="paisaje bonito">
        <figcaption>
           <h2 class="val">Lorem Ipsum</h2>
          <p class="desc">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.</p>
        </figcaption>
      </figure>
    </div>
    <div class="col-md-6 col-xs-12">
      <figure>
        <img class="tarjeta" src="https://cdn.pixabay.com/photo/2020/05/25/20/06/storm-5220380_1280.jpg" alt="otro paisajelindo">
        <figcaption>
           <h2 class="val">Lorem Ipsum</h2>
          <p class="desc">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.</p>
        </figcaption>
      </figure>
    </div>
  </div>
</div>
<footer>
  <p><strong>Nota:</strong> Figure no es soportado en Ie8</p>
</footer>
              
            
!

CSS

              
                /* Estilos basados en card component 
 * 
 * version 2019_12_26
 * Original: https://codepen.io/jstneg/pen/EVKYZj
 */

/*Usando figure*/

.contentB {
  position: absolute;
  bottom: 0;
  background: rgb(0, 0, 0);
  background: rgba(0, 0, 0, 0.5);
  color: #f1f1f1;
  width: 100%;
  padding: 0px 0px 20px 20px;
}
.content {
  position: relative;
  top: -113px;
  background: rgb(0, 0, 0);
  background: rgba(0, 0, 0, 0.5);
  color: #f1f1f1;
  width: 100%;
  padding: 0px 0px 20px 20px;
}

figure {
    border: thin #c0c0c0 solid;
    display: flex;
    flex-flow: column;
    padding: 5px;
    max-width: 800px;
    margin: auto;
}

.tarjeta {
    max-width: 820px;
    max-height: 600px;
}
.child_tarjeta{
  max-height: 216px;
}

figcaption {
    background-color: #222;
    color: #fff;
    padding: 20px;
    text-align: left;
}



/*Usando divs*/

.wrapper {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.wrapper > * {
  flex: 1;
  margin: 21px;
}
.wrapper > .box-wrap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wrapper > .box-wrap > .box:first-child {
  margin-top: 0;
}
.wrapper > .box-wrap > .box:last-child {
  margin-bottom: 0;
}
.box {
  border: 1px solid;
}

.card {
  background-color: #fff;
  border: 1px solid transparent;
}
.card > .card-link {
  color: #333;
}
.card > .card-link:hover {
  text-decoration: none;
}

.card .card-img {
  position: relative;
  padding: 0;
  display: table;
}
.card .card-img .card-caption {
  position: absolute;
  right: 0;
  bottom: 0px;
  left: 0;
  padding: 20px;
  text-align: left;
}
.card .card-body {
  display: table;
  width: 100%;
  padding: 12px;
}

.card .card-left {
  position: relative;
  float: left;
  padding: 0 0 8px 0;
}
.card .card-right {
  position: relative;
  float: left;
  padding: 8px 0 0 0;
}
.card .card-body h1:first-child,
.card .card-body h2:first-child,
.card .card-body h3:first-child,
.card .card-body h4:first-child,
.card .card-body .h1,
.card .card-body .h2,
.card .card-body .h3,
.card .card-body .h4 {
  margin-top: 0;
}
.card .card-body .heading {
  display: block;
}
.card .card-body .heading:last-child {
  margin-bottom: 0;
}

.card .card-body .lead {
  text-align: left;
}

@media (min-width: 768px) {
  .card .card-left {
    float: left;
    padding: 0 8px 0 0;
  }
  .card .card-right {
    float: left;
    padding: 0 0 0 8px;
  }

  .card .card-4-8 .card-left {
    width: 33.33333333%;
  }
  .card .card-4-8 .card-right {
    width: 66.66666667%;
  }

  .card .card-5-7 .card-left {
    width: 41.66666667%;
  }
  .card .card-5-7 .card-right {
    width: 58.33333333%;
  }

  .card .card-6-6 .card-left {
    width: 50%;
  }
  .card .card-6-6 .card-right {
    width: 50%;
  }

  .card .card-7-5 .card-left {
    width: 58.33333333%;
  }
  .card .card-7-5 .card-right {
    width: 41.66666667%;
  }

  .card .card-8-4 .card-left {
    width: 66.66666667%;
  }
  .card .card-8-4 .card-right {
    width: 33.33333333%;
  }
}

/* -- default theme ------ */
.card-default {
  border-color: #ddd;
  background-color: #fff;
  margin-bottom: 24px;
}
.card-default > .card-header,
.card-default > .card-footer {
  color: #333;
  background-color: #ddd;
}
.card-default > .card-header {
  border-bottom: 1px solid #ddd;
  padding: 8px;
}
.card-default > .card-footer {
  border-top: 1px solid #ddd;
  padding: 8px;
}
.card-default > .card-body {
}

.card-default > .card-left {
  padding-right: 4px;
}
.card-default > .card-right {
  padding-left: 4px;
}
.card-default p:last-child {
  margin-bottom: 0;
}
.card-default .card-caption {
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}

/* -- price theme ------ */
.card-price {
  border-color: #999;
  background-color: #ededed;
}
.card-price > .card-heading,
.card-price > .card-footer {
  color: #333;
  background-color: #fdfdfd;
}
.card-price > .card-heading {
  border-bottom: 1px solid #ddd;
  padding: 8px;
}
.card-price > .card-footer {
  border-top: 1px solid #ddd;
  padding: 8px;
}

.card-price > .card-left {
  padding-right: 4px;
}
.card-price > .card-right {
  padding-left: 4px;
}
.card-price .card-caption {
  color: #fff;
  text-align: center;
  background: #000000c7;
}
.card-price p:last-child {
  margin-bottom: 0;
}

.card-price .price {
  text-align: center;
  color: #337ab7;
  font-size: 3em;
  text-transform: uppercase;
  line-height: 0.7em;
  margin: 24px 0 16px;
}
.card-price .price small {
  font-size: 0.4em;
  color: #66a5da;
}
.card-price .details {
  list-style: none;
  margin-bottom: 24px;
  padding: 0 18px;
}
.card-price .details li {
  text-align: center;
  margin-bottom: 8px;
}
.card-price .buy-now {
  text-transform: uppercase;
}
.card-price table .price {
  font-size: 1.2em;
  font-weight: 700;
  text-align: left;
}


footer {
  padding: 25px;
}

              
            
!

JS

              
                
              
            
!
999px

Console