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 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

              
                <div id="mtn" class="section group">
	<div class="col span_3_of_12 title">Trail</div>
	<div class="col span_3_of_12 title">Status</div>
  <div class="col span_3_of_12 title">Groomed</div>
	<div class="col span_3_of_12 title">Difficulty</div>
</div>

<script>
var oXHR = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');

  function reportStatus() {
    if (oXHR.readyState == 4 && this.status == 200) // REQUEST COMPLETED.
      showTheList(this.responseXML); // ALL SET. NOW SHOW XML DATA.
  }

  oXHR.onreadystatechange = reportStatus;
  oXHR.open("GET", "https://www.sierraattahoe.com/mtnxml/", true); // true = ASYNCHRONOUS REQUEST (DESIRABLE), false = SYNCHRONOUS REQUEST.
  oXHR.send();  
  
function showTheList(xml) {

  var divBooks = document.getElementById('mtn');  // THE PARENT DIV.
  var Book_List = xml.getElementsByTagName('trails'); // THE XML TAG NAME.

  for (var i = 0; i < Book_List.length; i++) {

    // CREATE CHILD DIVS INSIDE THE PARENT DIV.
    var divOne = document.createElement('div');
    divOne.className = 'col span_3_of_12';
    divOne.innerHTML = Book_List[i].getElementsByTagName("trail")[0].getAttribute('name');

    var divTwo = document.createElement('div');
    divTwo.className = 'col span_3_of_12';
    divTwo.innerHTML = Book_List[i].getElementsByTagName("trail")[0].getAttribute('status');
    
    var divThree = document.createElement('div');
    divThree.className = 'col span_3_of_12';
    divThree.innerHTML = Book_List[i].getElementsByTagName("trail")[0].getAttribute('groomed');
    
    var divFour = document.createElement('div');
    divFour.className = 'col span_3_of_12';
    divFour.innerHTML = Book_List[i].getElementsByTagName("trail")[0].getAttribute('difficulty');

    // ADD THE CHILD TO THE PARENT DIV.
    divBooks.appendChild(divOne);
    divBooks.appendChild(divTwo);
    divBooks.appendChild(divThree);
    divBooks.appendChild(divFour);
  }
};  
</script>  
              
            
!

CSS

              
                body {font:16px Calibri;background-color:#aaa;}

/*  SECTIONS  */
.section {
	clear: both;
	padding: 0px;
	margin: 0px;
}

/*  COLUMN SETUP  */
.col {
  background: #f0f3f5;
	display: block;
	float:left;
	margin: .1%;
  padding:8px 0;
  text-align:center;
}
.col:first-child { margin-left: 0; }

/* Change background div color every other row  */
.col:nth-child(n+5):nth-child(-n+8), .col:nth-child(n+13):nth-child(-n+16) {
    background-color: #9fd3cc;
}

.title { 
  background-color: #2b4665;
  color: #f1f1f1;
  font-weight: bold;
  text-transform: uppercase;
}

/*  GROUPING  */
.group:before,
.group:after { content:""; display:table; }
.group:after { clear:both;}
.group { zoom:1; /* For IE 6/7 */ }

/*  GRID OF TWELVE  */
.span_12_of_12 {
	width: 100%;
}

.span_11_of_12 {
  	width: 91.53%;
}
.span_10_of_12 {
  	width: 83.06%;
}

.span_9_of_12 {
  	width: 74.6%;
}

.span_8_of_12 {
  	width: 66.13%;
}

.span_7_of_12 {
  	width: 57.66%;
}

.span_6_of_12 {
  	width: 49.2%;
}

.span_5_of_12 {
  	width: 40.73%;
}

.span_4_of_12 {
  	width: 32.26%;
}

.span_3_of_12 {
  	width: 23.8%;
}

.span_2_of_12 {
  	width: 15.33%;
}

.span_1_of_12 {
  	width: 6.866%;
}

.span_3_of_12:nth-child(4n+1) { 
	clear:left; 
	margin-left: 0;
	}

/*  GO FULL WIDTH BELOW 480 PIXELS */
@media only screen and (max-width: 480px) {
	.col {  margin: 1% 0 1% 0%; }
    
    .span_1_of_12, .span_2_of_12, .span_3_of_12, .span_4_of_12, .span_5_of_12, .span_6_of_12, .span_7_of_12, .span_8_of_12, .span_9_of_12, .span_10_of_12, .span_11_of_12, .span_12_of_12 {
	width: 100%; 
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console