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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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-fluid">
	<div class="jumbotron">
		<h1 class="display-4">Übersicht über unterschiedliche Card-Implementierungen</h1>
		<p class="lead">Bei Bootstrap 4 ist das Card-Modul neu und sehr flexibel einsetzbar.</p>
	</div>
</div>

<section class="mb-4">
	<div class="container">
		<h2><code>.card-deck</code> für gleich hohe Cards</h2>
		<div class="card-deck">
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
			</div>
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>
		</div>
	</div>
</section>

<hr class="my-4">

<section class="mb-4">
	<div class="container-fluid">
		<h2><code>.card-deck</code> für gleich hohe Cards</h2>
		<div class="card-deck">
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
			</div>
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>	
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
		</div>
	</div>
</section>

<hr class="my-4">

<div class="container-fluid">
	<h2>Die Cards stecken in einem Grid</h2>

	<div class="row">
		<div class="col-md-4">
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
			</div>
		</div>
		<div class="col-md-4">
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
			</div>
		</div>
		<div class="col-md-4">
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>
		</div>
	</div>
</div>

<hr class="my-4">

<section class="mb-4">
	<div class="container">
		<h2>Mit <code>.card-columns</code> können viele Cards in einen Container gepackt werden!</h2>
		<div class="card-columns">
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>	
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>				
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
			</div>

			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>

			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				
			</div>
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>				
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>	
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="Card image cap">
				<div class="card-body">
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
			</div>
			<div class="card">
				<img class="card-img-top" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
					<a href="#" class="btn btn-primary">Go somewhere</a>
				</div>
			</div>	
			<div class="card">
				<div class="card-body">
					<h5 class="card-title">Card title</h5>
					<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
					<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
				</div>
				<img class="card-img-bottom" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5028/blume-200x133.jpg" alt="">
				<div class="card-footer">
					<a href="#" class="card-link">Card link</a>
					<a href="#" class="card-link">Another link</a>
				</div>
			</div>		
		</div>
		<div class="alert alert-info">
			<p>Mit dieser Klasse werden die Cards nicht mit einer Flexbox umfasst, sondern mit dem Columns-Modul von CSS. Dadurch wird ein Layout im Masonry-Stil möglich. Die Orientierung geht also vertikal. Die Container sind extra durchnummeriert.</p>
		</div>
	</div>
</section>
              
            
!

CSS

              
                .card-columns {
	counter-reset: cards;
	
	.card {
		position: relative;
		counter-increment: cards;
		
		&:before {
			counter: cards;
			content: counter(cards);
			display: inline-block;
			padding: 5px 10px;
			background-color: #a20000;
			color: #fff;
			position: absolute;
			top: 0;
			right: 0;
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console