180 likes | 316 Views
This guide introduces HTML (Hypertext Markup Language) and the Document Object Model (DOM), highlighting their roles in structuring web documents. Learn about the interconnected nature of documents through hyperlinks, the importance of markup, and the distinction between declarative and imperative programming. Discover how tags define the structure within HTML and how the DOM represents this structure in a tree format. This foundational knowledge is essential for aspiring web developers looking to master the basics of web programming.
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.