Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

              
                <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
	<div class="collapse navbar-collapse justify-content-md-center" id="navbarsExample08">
		<ul class="navbar-nav">
			<li class="nav-item active">
				<a class="nav-link">Blog card</a>
			</li>
		</ul>
	</div>
</nav>

<div class="container">
	<section id="blog_area" class="pt-5">
		<div id="masonry">
			
			<div class="card">
					<div class="card__img">
							<a href="#">
									<img class="img-fluid" src="https://picsum.photos/500/200/?random" alt="Image 1">
							</a>
							<div class="card__date">
									<span>Jan. 1st 19</span>
							</div>
					</div>
					<div class="card__content">
							<h4 class="card__title">
									Card 1 Title
							</h4>
							<p class="card__content-jcenter">
									Haec subinde Constantius audiens et quaedam referente Thalassio doctus, quem eum odisse iam conpererat lege communi, scribens ad Caesarem blandius adiumenta paulatim illi subtraxit, sollicitari se simulans ne, uti est militare otium fere tumultuosum, in eius perniciem conspiraret, solisque scholis iussit esse contentum palatinis et protectorum cum Scutariis et Gentilibus, et mandabat Domitiano, ex comite largitionum, praefecto ut cum in Syriam venerit, Gallum, quem crebro acciverat, ad Italiam properare blande hortaretur et verecunde.
							</p>
							<span>
									<a href="#">Read more</a>
							</span>
					</div>
			</div>
    	<div class="card">
        <div class="card__img">
            <a href="#">
                <img class="img-fluid" src="https://picsum.photos/501/250/?random" alt="Image 1">
            </a>
            <div class="card__date">
                <span>Jan. 1st 19</span>
            </div>
        </div>
        <div class="card__content">
            <h4 class="card__title">
                Card 2 Title
            </h4>
            <p class="card__content-jcenter">
							Soleo saepe ante oculos ponere, idque libenter crebris usurpare sermonibus, omnis nostrorum imperatorum, omnis exterarum gentium potentissimorumque populorum, omnis clarissimorum regum res gestas, cum tuis nec contentionum magnitudine nec numero proeliorum nec varietate regionum nec celeritate conficiendi nec dissimilitudine bellorum posse conferri; nec vero disiunctissimas terras citius passibus cuiusquam potuisse peragrari, quam tuis non dicam cursibus, sed victoriis lustratae sunt.
            </p>
            <span>
            <a href="#">Read more</a>
        </span>
        </div>
    </div>
    	<div class="card">
        <div class="card__img">
            <a href="#">
                <img class="img-fluid" src="https://picsum.photos/505/225/?random" alt="Image 1">
            </a>
            <div class="card__date">
                <span>Jan. 1st 19</span>
            </div>
        </div>
        <div class="card__content">
            <h4 class="card__title">
                Card 3 Title
            </h4>
            <p class="card__content-jcenter">
                Cuius acerbitati uxor grave accesserat incentivum, germanitate Augusti turgida supra modum, quam Hannibaliano regi fratris filio antehac Constantinus iunxerat pater, Megaera quaedam mortalis, inflammatrix saevientis adsidua, humani cruoris avida nihil mitius quam maritus; qui paulatim eruditiores facti processu temporis ad nocendum per clandestinos versutosque rumigerulos conpertis leviter addere quaedam male suetos falsa et placentia sibi discentes, adfectati regni vel artium nefandarum calumnias insontibus adfligebant.
            </p>
            <span>
            <a href="#">Read more</a>
        </span>
        </div>
    </div>
    	<div class="card">
        <div class="card__img">
            <a href="#">
                <img class="img-fluid" src="https://picsum.photos/500/230/?random" alt="Image 1">
            </a>
            <div class="card__date">
                <span>Jan. 1st 19</span>
            </div>
        </div>
        <div class="card__content">
            <h4 class="card__title">
                Card 4 Title
            </h4>
            <p class="card__content-jcenter">
                Hac ex causa conlaticia stipe Valerius humatur ille Publicola et subsidiis amicorum mariti inops cum liberis uxor alitur Reguli et dotatur ex aerario filia Scipionis, cum nobilitas florem adultae virginis diuturnum absentia pauperis erubesceret patris.
            </p>
            <span>
            <a href="#">Read more</a>
        </span>
        </div>
    </div>
    	<div class="card">
        <div class="card__img">
            <a href="#">
                <img class="img-fluid" src="https://picsum.photos/600/300/?random" alt="Image 1">
            </a>
            <div class="card__date">
                <span>Jan. 1st 19</span>
            </div>
        </div>
        <div class="card__content">
            <h4 class="card__title">
                Card 5 Title
            </h4>
            <p class="card__content-jcenter">
                Saepissime igitur mihi de amicitia cogitanti maxime illud considerandum videri solet, utrum propter imbecillitatem atque inopiam desiderata sit amicitia, ut dandis recipiendisque meritis quod quisque minus per se ipse posset, id acciperet ab alio vicissimque redderet, an esset hoc quidem proprium amicitiae, sed antiquior et pulchrior et magis a natura ipsa profecta alia causa. Amor enim, ex quo amicitia nominata est, princeps est ad benevolentiam coniungendam. Nam utilitates quidem etiam ab iis percipiuntur saepe qui simulatione amicitiae coluntur et observantur temporis causa, in amicitia autem nihil fictum est, nihil simulatum et, quidquid est, id est verum et voluntarium.
            </p>
            <span>
            <a href="#">Read more</a>
        </span>
        </div>
    </div>
			<div class="card">
            <div class="card__img">
                <a href="#">
                    <img class="img-fluid" src="https://picsum.photos/600/400/?random" alt="Image 1">
                </a>
                <div class="card__date">
                    <span>Jan. 1st 19</span>
                </div>
            </div>
            <div class="card__content">
                <h4 class="card__title">
                    Card 6 Title
                </h4>
                <p class="card__content-jcenter">
                    Et quia Mesopotamiae tractus omnes crebro inquietari sueti praetenturis et stationibus servabantur agrariis, laevorsum flexo itinere Osdroenae subsederat extimas partes, novum parumque aliquando temptatum commentum adgressus. quod si impetrasset, fulminis modo cuncta vastarat. erat autem quod cogitabat huius modi.
                </p>
                <span>
                <a href="#">Read more</a>
            </span>
            </div>
        </div>

		</div>
	</section>
</div>
              
            
!

CSS

              
                $main-blue: #007bff;

body {
	padding-top: 5rem;
	min-height: 75rem;
}

a,
a:hover,
a:focus {
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease 0s;
}

#blog_area {
  .card {
    border-radius: 0.25rem;
    overflow: hidden;
    background: #fff;
    transition: all ease-in-out .3s;
    border: 0px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
		margin: 0 0 1em 0;

    &:hover {
      box-shadow: .1rem 1rem 2rem rgba(0, 0, 0, 0.12), -.1rem 0 2rem rgba(0, 0, 0, 0.12);
    }

    .card__img {
      position: relative;
      overflow: hidden;

      &:hover {
        border-top-left-radius: 0.25rem;
        border-top-right-radius: 0.25rem;
      }

      &:hover img {
        transform: scale(1.2);
      }

      & img {
        transition: all 1s ease 0s;
        width: 100%;
      }
    }

    .card__date {
      background: $main-blue;
      color: #fff;
      font-size: 14px;
      padding: 5px 10px;
      position: absolute;
      top: 0;
      left: 0;
      border-bottom-right-radius: 15px;
      font-weight: bold;
      opacity: 0.7;
      transition: opacity 0.25s ease-in-out;

      &:hover {
        opacity: 1;
      }
    }

    .card__content {
      margin: 5px 20px;
      padding-bottom: 15px;

      .card__title {
        text-transform: uppercase;
        margin-top: 10px;
        text-align: center;
        font-weight: bold;
      }

      h4 {
        margin-bottom: 10px;
        font-size: 17px;
      }

      .card__content-jcenter {
        text-align: justify;
        text-indent: 1rem;
      }

      & span > a {
        color: #fff;
        font-size: 14px;
        padding: 5px 10px;
        position: absolute;
        bottom: 0;
        right: 0;
        border-top-left-radius: 15px;
        font-weight: bold;
        background: $main-blue;
        opacity: 0.6;
				
        &:hover {
          opacity: 1;
        }
      }
    }
  }
}

#masonry {
  column-count: 1;
  column-gap: 1em;
}

@media(min-width: 30em) {
  #masonry {
    column-count: 1;
    column-gap: 1em;
  }
}

@media(min-width: 40em) {
  #masonry {
    column-count: 2;
    column-gap: 1em;
  }
}

@media(min-width: 60em) {
  #masonry {
    column-count: 3;
    column-gap: 1em;
  }
}

@media(min-width: 75em) {
  #masonry {
    column-count: 3;
    column-gap: 1em;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console