Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML Treehouse Club: HTML Publish a Story Comments and the DOCTYPE

Lee Ann Merrill
Lee Ann Merrill
1,103 Points

HTML is used to "structure" a web page?

A quiz question asks if HTML is used to "structure" a web page. I answered no because I've been thinking of it as the way to get the words into the page (rather than lay out the page). What mistake am I making?

3 Answers

Hey Lee Ann,

It is common practice to describe HTML as the structure of a web page.

Each and every web page has HTML page structure. This includes but is not limited to your html tag, head tag, and body tag. The browser does not display the HTML tags, but uses them to determine how to display the document.

With that being said, consider the definition of structure: 'the arrangement of and relations between the parts or elements of something complex.'

Brendon Butler
Brendon Butler
4,254 Points

To build off of Jacob's answer..

Think of HTML as the blueprints of a house. It's a 2D breakdown of all the elements. It contains all the parts of the house. Floors, walls, ceilings, etc.

CSS is then used to create A 3D build up of the blueprint, describing how each of the elements should look. How they're stacked on eachother, how they flow together, etc.

Let's say you have a <wall> tag in your HTML. Without css, the wall would either have default or no stlying. It would be blank. In CSS, you could make a call to that element which changes the attributes of it, ie: color, height, width, etc.

You're not just stuck to a single wall with nothing on it though. You could add a text element of some sort within the opening and closing wall tags. You could also add, let's say a <pictureFrame> element to hold a picture (which would be defined in css). That picture frame would be stuck somewhere within the boundaries of it's parent -- the <wall> element.

I hope that makes sense. I had a good idea for what I was trying to say, but relayed it slowly on a cellphone.

Lee Ann Merrill
Lee Ann Merrill
1,103 Points

Thanks guys. I've just done the first HTML lesson and as suggested I deleted a lot of stuff without it having any affect on how the preview page looked. Below is is how it looked. I deleted and/or changed a lot of stuff above <body> but the only thing that had any effect on how the preview page looked was the CSS stuff. I also changed the spaces between the lines and that didn't make any difference (maybe that's true only in the body part). Is <body> the signal that the words should start showing up on the actual page? If so, why does the style stuff go in the head?

<!DOCTYPE html> <html> <head>

<title>Please Kill Me Now</title> <meta charset="utf-8">

<style> h1 {text-align: center; color: orange} h2 {text-align: center; color: red} </style>

</head>

<body> <h1>Leadership Vacuum</h1> <h2>By Lee Ann Merrill</h2>

<p> Well everything was fine I woke up this morning though and my leg was completely numb. I didn't think much of it so I sat up on the side of my bed, leaned over to grab the nearest pair of pants off the ground, opened them up and