cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.


  <title>Weather App</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

  <div class="main">
    <h1>Weather App</h1>
    <p>The temperature in <span id="city">San Francisco</span> is <span id="temp">70</span>º <button id="farcel" data-temp="F" title="click to view weather in Celsius">F</button></p>
    <p><img id="weatherIcon" src="http://openweathermap.org/img/w/01d.png" alt=""><span id="weatherType"></span></p>
    jQuery(function($) {
    			$(document).ready(function() {
    				var apiKey = "c9f15b50a0228501fd6b4f89a46e0e83";
    				var info;
    				var weather;
    				var cel;
    				var far;
    				var weatherType;
    				$.get('http://ipinfo.io/json', function(result) {
    					info = result;
    					var url = "http://api.openweathermap.org/data/2.5/weather?q=";
    					url += info.postal;
    					url += "&appid=c9f15b50a0228501fd6b4f89a46e0e83";
    					$.get(url, function(res) {
    						far = Math.floor(res.main.temp * 9 / 5 - 459.67);
    						cel = Math.floor(res.main.temp - 273.15);
    						weatherType = res.weather[0].main;
    						var city = info.city;
    				$('#farcel').on('click', function() {
    					var temp = $(this).data('temp');
    					if (temp == "F") {
    						$(this).data('temp', 'C');
    					} else {
    						$(this).data('temp', 'F');

              * {
  box-sizing: border-box;

body {
  font-family: sans-serif;
  background-color: #1d1f20;
  color: white;
  font-size: 28px;

h1 {
  font-size: 80px;
  margin-bottom: 50px;

p {
  margin-bottom: 50px;

button {
  border: none;
  background-color: #1d1f20;
  color: #0af;
  cursor: pointer;
  padding: 0;
  font-weight: bold;
  font-size: 22px;
  border-bottom: 1px solid;

.main {
  text-align: center;

#weatherIcon {
  margin-right: 10px;

#weatherType {
  font-size: 3rem;
Loading ..................