Explaining basic html structure I am trying to think of a lesson plan about html, and I am looking for a good way to explain the concept of the structure of an html file.

I was wondering whether the subject would be better understood if I firstly described xml in general. What I had in mind is teaching a basic xml block:

&lt;rootElement&gt;
    &lt;element withAttribute="that we can set" scndAttr="there can be more than 1 attribute"&gt;
        &lt;subElement otherAttr="these can also have attributes" /&gt;
    &lt;/element&gt;
&lt;/rootElement&gt;


and then use this basic block to get into the subject, after which we veer off to html specific xmls. 

The students are at a beginner's level, and HTML is the first technology with a structure like this that they will encounter, So this lesson is meant to introduce them to HTML.

So, is knowing the concept and basics of xml structure important and necessary for understanding html?
How did you begin to teach Java to your students? I bet you didn't start by showing them the Backus-Naur form that the Java parser follows. Instead, you probably introduced a simple "Hello, world" program, and slowly built on that with assignments and projects for the students to work on.

I'm sure you can see the parallel here—teaching XML as a prerequisite for HTML is not, in my opinion, a productive or helpful exercise. XML is a rather boring language; it doesn't do anything, so you don't get that instant feedback when you write some code, unlike in HTML, where you can see the webpage unfold as you add elements.

HTML is also simple enough that you can generally pick it up as you go along; explaining that you start an element with &lt;tag&gt; and end with &lt;/tag&gt; should be simple enough, and any mistakes in the markup will be visible when you load the page.

As a general rule, if you want to teach [insert language here], you probably don't need to teach a different language first; teaching XML to make HTML easier probably won't give you the benefits you're expecting.

I'm rather partial to the typical "Hello, world" for HTML. Almost certainly, your students will spot that the title is "My First Webpage", and I imagine that they'll be able to guess &lt;h1&gt; with some guidance.

&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;My First Webpage&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;Hello, world!&lt;/h1&gt;
    &lt;/body&gt;
&lt;/html&gt;


The general structure should be obvious, and you can reinforce it with some tasks, such as:


  
  Add a paragraph (&lt;p&gt;) after the heading.
  Add this image: [insert image link here] using &lt;img&gt;
  


I would expect that &lt;img&gt; would need some explanation, because it will be the first element with attributes, and it's self-closing, which is different to all the others.