180 likes | 308 Views
HTML and the DOM. What is HTML?. Hypertext Interconnected documents Markup Our code goes around our documents Language Yes, it’s programming. What you want n ot how you want it. Declarative programming. Imperative programming. C/C++ JavaScript
E N D
What is HTML? • Hypertext • Interconnected documents • Markup • Our code goes around our documents • Language • Yes, it’s programming
What you want not how you want it Declarative programming
Imperative programming • C/C++ • JavaScript • Most everything you think of as programming
Markup • We surround our data with tags to declare how they are to be treated.
<p>This is my first paragraph. In this paragraph some parts <em>need to be emphasized</em>.</p> • <ul> • <li>This is the first item in a list</li> • <li>The browser wouldn’t know it’s a list</li> • <li>Except for the tags around this text</li> • </ul>
HyperText • The text documents are interconnected inside the text
Anchor tag • <a href="http://example.org/somedocument.html">Check out some document!</a>
Hypertext markup language Hyper reference Hypertext transfer protocol Hyper === interconnected
So what is HTML? • A way of defining the *structure* of a document.
Document Object Model • The in-memory model of an HTML Document
The DOM is a tree The file system is a tree The DOM is a tree The DOM is a tree made up of text nodes and HTML Element nodes (tags) • The filesystem is a tree made up of files and directories.
2 Types of Tags get Rendered • Block Tags • Inline Tags
Seebasicpage.html demo. Let’s take a look at some code
HTML is about STRUCTURE. HTML is not where we change font, colours, sizes, etc.