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

Auto Save

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 id="template">
  <!-- edit template below -->
<div class="onebox-result {class}">
<div class="onebox-header-wrapper">
<div class="onebox-header">
<a href="{url}" target="_blank" rel="nofollow">{favicon}<span class="onebox-sitename">{sitename}</span></a> / <span class="onebox-title"><a href="{url}" target="_blank">{title}</a></span>
<span class="onebox-title-button">{title-button}</span>
</div>
</div>
<div class="onebox-body-wrapper">
<a href="{url}" target="_blank">{image}</a>
<div class="onebox-body">
<p class="onebox-description">{description} — <a href="{url}">Read More</a></p><p class="onebox-additional">{additional}</p>
</div>
</div>
<div class="onebox-footer-wrapper">
<div class="onebox-footer"><span class="onebox-footer-info">{footer}</span><span class="onebox-footer-button">{footer-button}</span></div>
</div>
<div class="onebox-clearfix"></div>
</div>
  <!-- stop making changes -->
</div>

<div class="onebox-container"></div>
<input type="checkbox" id="flat" disabled="disabled"/>Flat
<input type="checkbox" id="dark" disabled="disabled"/>Dark
<small>Change the JS paramters to switch between themes</small>
              
            
!

CSS

              
                #template {display:none;}
a {color:#ff5e5e;}

/* onebox */

.onebox-container {
	clear:both;
	width: auto;
	margin-bottom: 10px;
}

.onebox-container * {
	list-style: none;
	margin: 0;
	padding: 0;
	outline: 0;
	text-decoration: none;
	box-sizing: border-box !important;
	-webkit-box-sizing: border-box !important;
	-moz-box-sizing: border-box !important;
	-ms-box-sizing: border-box !important;
}

.onebox-sitename:after{
	display: inline-block;
	clear: none;
}

.onebox-result {
	-webkit-border-radius: 6px;
	-moz-border-radius: 6px;
	border-radius: 6px;
	border: 1px solid #ddd;
	display: table;
	overflow: hidden;
}

.dark.onebox-result {
	border: 1px solid black;
}

.flat.onebox-result {
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border-radius: 2px;
}

.dark.flat.onebox-result {
	border-color: #222222;
}

.onebox-header-wrapper, .onebox-body-wrapper, .onebox-footer-wrapper {
	-moz-box-shadow: inset 0 2px 0 -1px rgba(255,255,255,0.2);
	-webkit-box-shadow: inset 0 2px 0 -1px rgba(255,255,255,0.2);
	box-shadow: inset 0 2px 0 -1px rgba(255,255,255,0.2);
}

.flat .onebox-header-wrapper, .flat .onebox-body-wrapper, .flat .onebox-footer-wrapper {
	-moz-box-shadow: none;
	-webkit-box-shadow: none;
	box-shadow: none;
}

.onebox-header-wrapper, .onebox-footer-wrapper {
	width: 100%;
	display: table;
}

.onebox-header-wrapper {
	border-bottom: 1px solid #fff;
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	background:#fcfcfc;
	background:-moz-linear-gradient(#fcfcfc,#ebebeb);
	background:-webkit-linear-gradient(#fcfcfc,#ebebeb);
}

.dark .onebox-header-wrapper {
	color: #fff;
	border-bottom: 1px solid #000;
	background: #464646; /* Old browsers */
	background: -moz-linear-gradient(top, #464646 0%, #3f3f3f 50%, #3f3f3f 51%, #3d3d3d 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#464646), color-stop(50%,#3f3f3f), color-stop(51%,#3f3f3f), color-stop(100%,#3d3d3d)); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top, #464646 0%,#3f3f3f 50%,#3f3f3f 51%,#3d3d3d 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top, #464646 0%,#3f3f3f 50%,#3f3f3f 51%,#3d3d3d 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(top, #464646 0%,#3f3f3f 50%,#3f3f3f 51%,#3d3d3d 100%); /* IE10+ */
	background: linear-gradient(to bottom, #464646 0%,#3f3f3f 50%,#3f3f3f 51%,#3d3d3d 100%); /* W3C */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#464646', endColorstr='#3d3d3d',GradientType=0 ); /* IE6-9 */
}

.flat .onebox-header-wrapper {
	background: #fff;
	border-bottom:1px solid #ddd;
}

.dark.flat .onebox-header-wrapper {
	background: #2e3133;
  border-bottom-color: #222222;
}

.onebox-header {
	font-size: 1.2em;
	line-height: 23px;
	display: table;
	width: 100%;
}

.onebox-header a {
	text-decoration: none;
}

.onebox-title {
	font-weight: bold;
	text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
	margin-right: 10px;
}

.flat .onebox-title {
	text-shadow: none;
}

.onebox-header img.onebox-favicon {
	margin-right: 5px;
	height:23px;
	width:23px;
	float: left;
	border: none;
	background: none;
	box-shadow: none;
}

.flat .onebox-header img.onebox-favicon {
	-webkit-border-radius: 500px;
	-moz-border-radius: 500px;
	border-radius: 500px;
}

.onebox-header .onebox-title-button {
	float: right;
	font-size: 0.75em;
	color: #999;
	line-height: 22px;
}
.onebox-header .onebox-title-button a {
	display:inline-block;
	height:21px;
	color:#666;
	border:1px solid #ddd;
	border-radius:3px;
	padding:0 5px;
	background: white;
	line-height: 21px;
}

.dark .onebox-header .onebox-title-button a {
	background: #aaa;
	border-color: #555;
	color: #333;
}

.flat .onebox-header .onebox-title-button a {
	background: #fff;
	border:none;
	color: #45a6cc;
}

.dark.flat .onebox-header .onebox-title-button a {
	background: #2e3133;
	border:none;
	color: #26a97c;
}

.flat .onebox-header .onebox-title-button a:hover {
	background: #eee;
}

.dark.flat .onebox-header .onebox-title-button a:hover {
	background: #202020;
}

.flat .onebox-header .onebox-rating {
	color: #26a97c;
}

.onebox-body-wrapper {
	display: table;
	width: 100%;
	padding-top: 10px;
	padding-bottom: 10px;
	padding-left: 15px;
	padding-right: 15px;
	background:#fafafa;
}

.dark .onebox-body-wrapper {
	background-color: #415a84;
}

.flat .onebox-body-wrapper {
	background-color: #fff;
}

.dark.flat .onebox-body-wrapper {
	background-color: #2e3133;
}

.onebox-body {
	display:block;
	overflow:hidden;
}

.onebox-body table, .onebox-body tr, .onebox-body td {
	border: none;
	background: none;
}

.dark .onebox-body {
	color: #ddd;
}

.onebox-body td {
	padding-right: 4px;
}

.onebox-footer-wrapper {
	border-top:1px solid #ddd;
	background:white;
	color: #666;
	line-height: 32px;
	padding-left: 10px;
	padding-right: 10px;
}

.dark .onebox-footer-wrapper {
	border-top-color: #464646;
	background: #3d5277;
	color: #ddd;
}

.flat .onebox-footer-wrapper {
	color: #b8b8b8;
}

.dark.flat .onebox-footer-wrapper {
	border-top-color: #222222;
	background: #2e3133;
}

.onebox-footer-wrapper .onebox-footer-info {
	font-size: 0.8em;
}

.onebox-footer-wrapper span.onebox-footer-button {
	float:right;
	line-height:32px;
}
.onebox-footer-wrapper .onebox-footer-button a {
	height:24px;
	font-size:12px;
	color:#666;
	font-weight:bold;
	text-shadow:0 1px 0 rgba(255,255,255,0.9);
	padding:5px 10px;
	margin-top: 5px;
	margin-bottom: 5px;
	margin-right: -5px;
	border:1px solid #ddd;
	border-bottom-color:#bbb;
	border-radius:3px;
	background:#f5f5f5;
	background:-moz-linear-gradient(#f5f5f5,#e5e5e5);
	background:-webkit-linear-gradient(#f5f5f5,#e5e5e5);
	text-decoration: none;
}

.dark .onebox-footer-wrapper .onebox-footer-button a {
	color:#ddd;
	background: #666;
	border:1px solid #333;
	border-top-color:#666;
	text-shadow:0 1px 0 rgba(0,0,0,0.2);
	padding-top: 2px;
	padding-bottom: 2px;
}

.flat .onebox-footer-wrapper .onebox-footer-button a {
	color: #fff;
	background: #45a6cc;
	text-shadow: none;
}

.dark.flat .onebox-footer-wrapper .onebox-footer-button a {
	color: #f7f5f2;
	background: #26a97c;
  border: none;
}

.onebox-footer-wrapper .onebox-footer-button a:hover {
	color:#527894;
	border-color:#cfe3ed;
	border-bottom-color:#9fc7db;
	background:#f1f7fa;
	background:-moz-linear-gradient(#f1f7fa,#dbeaf1);
	background:-webkit-linear-gradient(#f1f7fa,#dbeaf1);
}

.dark .onebox-footer-wrapper .onebox-footer-button a:hover {
	color:#f5f5f5;
	background: #999;
	border:1px solid #666;
	border-top-color:#999;
}

.flat .onebox-footer-wrapper .onebox-footer-button a:hover {
	color: #fff;
	background: #2e3133;
  border: none;
}

.dark.flat .onebox-footer-wrapper .onebox-footer-button a:hover {
	color: #fff;
	background: #278a68;
  border: none;
}

img.onebox-thumbnail {
	max-width: 25%;
	height: auto;
	max-height: 150px;
	margin-right: 10px;
	border-radius: 3px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	float: left;
}

.flat img.onebox-thumbnail {
	border-radius: 6px;
	box-shadow: 0 0 0 4px #eee;
}

.dark.flat img.onebox-thumbnail {
	box-shadow: 0 0 0 4px #222222;
}

.onebox-description {
	color:#666;
}

.dark .onebox-description {
	color:#ddd;
}

.flat .onebox-description {
	border-left: 7px solid #eee;
	margin-left: 3px;
	padding-left: 8px;
}

.dark.flat .onebox-description {
	border-color: #565859;
}

p.onebox-description, p.onebox-additional {
	margin-bottom: 0;
}

.onebox-additional {
	color:#999;
	font-size: 0.8em;
}

.dark .onebox-additional {
	color: #ccc;
}

.flat .onebox-additional {
	color: #b8b8b8;
}

.onebox-stars {
	float: left;
	margin: 2px;
}

span.onebox-stars, span.onebox-stars span {
    display: block;
    background: url(stars.png) 0 -16px repeat-x;
    width: 80px;
    height: 16px;
}

.flat span.onebox-stars, .flat span.onebox-stars span {
	background-image: url(stars-flat.png);
}

span.onebox-stars span {
    background-position: 0 0;
}

i.onebox-icon {
	width: 16px;
	height: 16px;
	background-repeat: no-repeat;
	background-size: contain;
	float: left;
	margin-top: 2px;
	margin-bottom: 2px;
	margin-right: 5px;
	opacity: 0.5;
}

.dark i.onebox-icon {
	opacity: 1;
}

.flat i.onebox-icon {
	opacity: 1;
}

.onebox-eye-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-eye.png");
}
.flat .onebox-eye-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-eye-flat.png");
}
.dark.flat .onebox-eye-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-eye-dark-flat.png");
}
.onebox-star-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-star.png");
}
.flat .onebox-star-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-star-flat.png");
}
.dark.flat .onebox-star-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-star-dark-flat.png");
}
.onebox-fork-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-fork.png");
}
.flat .onebox-fork-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-fork-flat.png");
}
.dark.flat .onebox-fork-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-fork-dark-flat.png");
}
.onebox-thumbsup-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-thumbsup.png");
}
.flat .onebox-thumbsup-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-thumbsup-flat.png");
}
.dark.flat .onebox-thumbsup-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-thumbsup-dark-flat.png");
}
.onebox-trophy-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-trophy.png");
}
.flat .onebox-trophy-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-trophy-flat.png");
}
.dark.flat .onebox-trophy-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-trophy-dark-flat.png");
}
.onebox-note-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-note.png");
}
.flat .onebox-note-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-note-flat.png");
}
.dark.flat .onebox-note-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-note-dark-flat.png");
}
.onebox-comment-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-comment.png");
}
.flat .onebox-comment-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-comment-flat.png");
}
.dark.flat .onebox-comment-icon {
	background-image: url("http://onebox.surrealroad.com/wp-content/plugins/onebox/style/icon-comment-dark-flat.png");
}

/* http://nicolasgallagher.com/micro-clearfix-hack/ */
.onebox-clearfix:before, .onebox-clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.onebox-clearfix:after {
    clear: both;
}
              
            
!

JS

              
                var OneboxParams = {"flat":true,"dark":false};

var data = 
{"data":{"url":"https:\/\/github.com\/twbs\/bootstrap","displayurl":"","countrycode":"GB","sitename":"GitHub","title":"twbs\/bootstrap","image":"https:\/\/avatars1.githubusercontent.com\/u\/2918581?s=400","favicon":"https:\/\/github.com\/apple-touch-icon-114.png","description":"The most popular front-end framework for developing responsive, mobile first projects on the web.","additional":"Latest commit: Merge pull request #13422 from twbs\/ie-emulation-modes-warning\n\nWarn about IE emulation modes in docs+examples","footer":"<strong>7961<\/strong> commits &middot; Latest commit: <strong>28 April 2014<\/strong> ","footerbutton":"<a href=\"https:\/\/github.com\/twbs\/bootstrap\/zipball\/master\" title=\"Get an archive of this repository\">Download as zip<\/a>","titlebutton":"<a href=\"https:\/\/github.com\/twbs\/bootstrap\/watchers\" title=\"See watchers\"><i class=\"onebox-icon onebox-eye-icon\"><\/i> 67186<\/a> <a href=\"https:\/\/github.com\/twbs\/bootstrap\/stargazers\" title=\"See stargazers\"><i class=\"onebox-icon onebox-star-icon\"><\/i> 67186<\/a> <a href=\"https:\/\/github.com\/twbs\/bootstrap\/network\/members\" title=\"See forkers\"><i class=\"onebox-icon onebox-fork-icon\"><\/i> 24474<\/a>"},"classes":"onebox-github"};

$this = $("#template");

if(data.data) {
	if(data.data.displayurl) url = data.data.displayurl;
	else url = data.data.url;
	var template = $this.html();
	if(OneboxParams.flat) data.classes +=' flat';
	if(OneboxParams.dark) data.classes +=' dark';
	template = template.replace(/{url}/g, url);
	template = template.replace(/{class}/g, data.classes);
	if(data.data.favicon) template = template.replace(/{favicon}/g, '<img src="' + data.data.favicon + '" class="onebox-favicon"/>');
	else template = template.replace(/{favicon}/g, '');
	template = template.replace(/{sitename}/g, data.data.sitename);
	if(data.data.image) template = template.replace(/{image}/g, '<img src="' + data.data.image + '" class="onebox-thumbnail"/>');
	else template = template.replace(/{image}/g, '');
	template = template.replace(/{title}/g, data.data.title);
	template = template.replace(/{description}/g, data.data.description);
	template = template.replace(/{additional}/g, data.data.additional);
	template = template.replace(/{footer}/g, data.data.footer);
	template = template.replace(/{title-button}/g, data.data.titlebutton);
	template = template.replace(/{footer-button}/g, data.data.footerbutton);

  if(OneboxParams.dark) {
    $("body").css("background", "#1d1f20");
    $("#dark").attr("checked", true);
  } else $("body").css("background", "#f7f5f2");
  if(OneboxParams.flat) $("#flat").attr("checked", true);
  
  $(".onebox-container").html(template);
}
              
            
!
999px

Console