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

              
                

		<form id="form-container" class="form-container">
			<label for="street">Street: </label><input type="text" id="street" value="">
			<label for="city">City: </label><input type="text" id="city" value="">
			<button id="submit-btn">Submit</button>
		</form>

		<hr>
<body>

		<h2 id="greeting" class="greeting">Where do you want to live?</h2>


		<div class="wikipedia-container">
			<h3 id="wikipedia-header">Relevant Wikipedia Links</h3>
			<ul id="wikipedia-links">Type in an address above and find relevant Wikipedia articles here!</ul>
		</div>


		<div class="nytimes-container">
			<h3 id="nytimes-header">New York Times Articles</h3>
			<ul id="nytimes-articles" class="article-list">What's going on in your new city? Enter an address and hit submit and the NY Times will tell you here!</ul>
		</div>

		<script src="js/libs/jquery.min.js"></script>
		<script src="js/script.js"></script>
	</body>
	</html>

              
            
!

CSS

              
                	* {box-sizing:border-box;}
	body {background-color: #CCC;}

	.bgimg {
		position:fixed;
		top: 0;
		left: 0;
		width:100%;
		z-index:-1;
		opacity:1;
	}

	.greeting {
		color:black;
		text-shadow: 1px 1px 3px rgba(255,255,255, .5);
		text-align: center;
	}

	.wikipedia-container {
		float:right;
		width:290px;
		padding:10px;
		margin-right: 10px;
		background-color: rgba(255,255,255,0.7);
	}

	.nytimes-container {
		padding: 10px;
		margin-right:300px;
		background-color: rgba(255,255,255,0.7);
	}

	.article-list {
		margin: 0;
		padding: 0;
	}

	.article {
		list-style-type: none;
		padding:10px;
		border-top: 1px solid #CCC;
	}
	.article:first-child {
		border-top:none;
	}
              
            
!

JS

              
                
	function loadData() {

		var $body = $('body');
		var $wikiElem = $('#wikipedia-links');
		var $nytHeaderElem = $('#nytimes-header');
		var $nytElem = $('#nytimes-articles');
		var $greeting = $('#greeting');

		// clear out old data before new request
		$wikiElem.text("");
		$nytElem.text("");
		
		var $street = $("#street").val();
		var $city = $("#city").val();
		var $address = $street + ", " +$city;
		var $apikey = "AIzaSyCXli2nnVED-A8-hFmSpE9XyHjohAeAYmM";

		// load streetview
		var streetViewHandler = 
		"https://maps.googleapis.com/maps/api/streetview?size=600x400&location=" + $address + '&key' + $apikey;
		 $body.append('<img class="bgimg" src="' + streetViewHandler + '">');
		// YOUR CODE GOES HERE!

		return false;
	};

	$('#form-container').submit(loadData);

              
            
!
999px

Console