The HTML Hierarchy: Thinking Inside the Box

By  Lee Underwood

When we think of HTML coding, we tend to think of elements (“tags”) used to structure a Web page. There are elements that define the body of the page, others to define paragraphs and still others for emphasizing text. It’s unusual to think about visualizing the code; our interest is usually focused on the appearance of the final product. In contrast, learning to visualize the structure of the code — seeing it the way the browser does — can actually help in the design of the page.

Part of learning Cascading Style Sheets (CSS) is understanding inheritance. That is, the relationship of a given element to its parent element and its child and sibling elements. For example, the <em> element inherits certain characteristics from the <p> element, which inherits certain characteristics from the <body> element. This schematic of inheritance can also help us to understand the HTML layout of a coded Web page. It can also help when we are referring to elements using JavaScript. If we learn this relationship at the beginning, it makes each additional step that much easier.

HTML Containers

As I said previously, when we speak of HTML, we generally talk about tags or elements, but HTML is much more than that. If we can visualize it, it can help us to understand what’s happening with the content that we place on the page. For instance, if we want to create a paragraph, we would enclose the text with the paragraph elements, <p></p>. If we wanted to emphasize one of more of the words in the paragraph, we could enclose them in the text elements <strong></strong>. Then, if we wanted to create a numbered list, we would use the list item elements, <li></li>, enclosed in the list elements, <ol></ol>. All of that might be wrapped in a division element, <div></div>.

All of that makes perfect sense as far as coding the document goes but what does the actual structure look like? How does that make sense to someone learning HTML? If we could visualize it graphically it would deepen our understanding, as in the graphic below.

HTML container

Is that structured or what? This is what an HTML document looks like with basic coding; this is what the browser sees. (I didn’t include the DOCTYPE statement because it’s not part of the HTML container.) When you look at the page the first and last elements you see are the opening and closing <HTML> elements. They make up the “HTML container.” It “contains” all of the other elements, such as text, scripts, etc. Let’s take a look at what is actually happening here.

This complete blog post is from http://www.webreference.com/html/rendering/ on November, 17th, 2010.

Wuhan China – Day 9

Taught a class today on basic HTML. It went well. Students worked collaboratively and built some good, simple pages. I then headed out and about on the town and saw some interesting sights. I am captivated by the small differences I see here and there. Like hundreds of bikes parked outside a dorm. Don’t see that everyday in Olympia. Heck, we have a larger bike population but nothing like in Wuhan. Wealth is measured in many ways. To walk the streets of Wuhan, I am an observer of many versions of wealth. The most common is joy. I see a lot of joy among kids running around and friends walking and talking.

Sample Web Page – Project 4

Sample Page Made at W3Schools.com

Scott Le Duc

Scott Le Duc

About Me

My name is Scott Le Duc. I have been a learner all of my life. I am an autodidact. So, I am in the right profession.

I currently work at Capital High School as a Career and Technical Educator focusing on art and technology instruction, and Lesley University, City University, St. Martin’s University and Wuhan University of Technology as an adjunct faculty.

Details

Favorites Things

  • I like to surf.
  • I love to eat
    1. Fresh Fruits
    2. Fresh Berries
    3. Oatmeal
    4. and I make weird shakes of yummy stuff now and then
  • I like to surf and play basketball.
  • I like to take pictures.
  • I like to play guitar and sing.
  • My favoritye color is blue, but I like green a lot, too.

Sample Page Code

<html>
<body>
<img src=”http://turnbows.net/~sleduc/scott_simpson.png” alt=”Scott Le Duc” width=”150″ height=”150″ />

<h1>Scott Le Duc</h1>
<h2>About Me</h2>
<p>My name is Scott Le Duc. I have been a learner all of my life. I am an autodidact. So, I am in the right profession.</p>

<p>I currently work at Capital High School as a Career and Technical Educator focusing on art and technology instruction, and Lesley University, City University, St. Martin’s University and Wuhan University of Technology as an adjunct faculty.</p>

<h3>Details</h3>

<ul>
<li>I am 41 years old.</li>
<li>I am from <a href=”http://maps.google.com/maps?f=q&source=s_q&hl=zh-CN&geocode=&q=Green+Bay,+WI,+United+States&sll=44.52001,-88.044434&sspn=1.840826,3.521118&ie=UTF8&hq=&hnear=%E6%A0%BC%E6%9E%97%E8%B4%9D,+%E5%B8%83%E6%9C%97%E5%8E%BF,+%E5%A8%81%E6%96%AF%E5%BA%B7%E8%BE%9B%E5%B7%9E&z=11″>Green Bay, WI</a> originally, but I live in <a href=”http://maps.google.com/maps?f=q&source=s_q&hl=zh-CN&geocode=&q=Olympia,+WA,+United+States&sll=44.518541,-88.019714&sspn=0.231089,0.44014&ie=UTF8&hq=&hnear=%E5%A5%A5%E6%9E%97%E5%8C%B9%E4%BA%9A,+%E7%91%9F%E6%96%AF%E9%A1%BF%E5%8E%BF,+%E5%8D%8E%E7%9B%9B%E9%A1%BF%E5%B7%9E&z=12″>Olympia, WA.</a></li>
<li>I am a professional teacher but I want to develop skills in <a href=”http://turnbows.net/~sleduc/scottleduc_original/careers.html”>many careers</a> in my life</li>
</ul>
<h3>Favorites Things</h3>
<ul>
<li>I like to surf.</li>
<li>I love to eat
<ol>
<li>Fresh Fruits</li>
<li>Fresh Berries</li>
<li>Oatmeal</li>
<li>and I make weird shakes of yummy stuff now and then</li>
</ol>
</li>
<li>I like to surf and play basketball.</li>
<li>I like to take <a href=”http://www.flickr.com/photos/scottleduc”>pictures</a>.</li>
<li>I like to play <a href=”https://scottleduc.org/music/”>guitar and sing</a>.</li>
<li>My favoritye color is blue, but I like green a lot, too.</li>

</ul>

</body>
</html>

Wuhan China – Day 7 and 8


Yesterday it was cold and rainy in Wuhan. Very much like a Northwest winter day. Check out the current weather right now! Today it is not raining but still a bit chilly, at least for Wuhan. It has been in the mid-seventies most of last week. It was a great day to spend indoors with my stuffed critters and work on class material, which is exactly what I did.   I updated the curriculum for the Software Engineering Class Web Site. I am using the free, Open Source, concept mapping program FreeMind to brainstorm the Parts of the Software Engineering Curriculum.

Today, November 15th, I taught two more classes and the students researched terms of software engineering. They were under impressed with the idea, but they worked hard to accomplish the task. One of them asked that they not have to do as much pure research and more project-based work. I was excited to hear his request. That’s the way I roll anyway. So, we are jumping into Project-based learning tomorrow.