CIS195 Web Authoring 1: HTML

More Basic HTML Elements

Topics by Week for the Ten-Week Term
1. Intro to HTML 6. Layout with CSS
2. More HTML, file paths 7. CSS Flexbox and Grid
3. Site structure and navigation 8. HTML Forms
4. Formatting with CSS 9. Multimedia
5. Midterm, Project Propposal 10. Tables, Project Completion
11. Final

 

Contents

Q and A

Review

Empty web site skeleton:

 

HTML elements you've learned so far:

 

Checking Your Code

Visual Studio Code

VS Code will automatically let you know if you make mistakes (use wrong syntax) in your HTML code. It does this by turning the code where it detects the error red.

HTML_syntax_error

 

W3C Syntax Validator

Define "syntax"

W3C HTML Validator

 

In-line and Block Elements

In-line elements arrange themselves horizontally on the page. Examples are:

Block elements arrange themselves vertically on the page. Examples are:

Nested Elements

Some elements can be nested, placed inside, other elements. You've already seen that in the basic skeleton of a web site where the body and head are nested inside the html element. To make the code easier to read, we indent the nested elements.
Here's an example:

Nesting Rules

Nested Lists

Lists can be placed within lists. The right way to do it is to put the nested list inside a li element of the parent list. For example:

In a browser, the nested lists would look like this:

 

More HTML Elements

Figures

Figures are used to change images from inline to block elements. They also allow you to add a caption to the image.

Try it out: Figure on W3Schools

Block Quotes

The block quote element will:

In a browser the blockquote would look like this:

Not all who wander are lost.

Try it out: Blockquote on W3Schools

Cite

Use this element to cite the work of someone else.

If we put this inside the block quote, it will look like this in the browser

Not all who wander are lost.
from "The Riddle of Strider" in The Fellowship of the Ring by J.R.R. Tolkien

Special Characters

Certain characters are not allowed (reserved characters) in HTML. For example, if you use the less than, <, or greater than, >, signs in your text, the browser is likely to see them as tags. The solution is to use character entities to display reserved characters. The code below shows two ways to write the character entities for < and >

Here are two ways to write the character entity for the copyright symbol, ©

Listing of special characters on W3Schools

Emojis for the Web on W3Schools

Comments

Horizontal Rule

The <hr> tag will put a horizontal line across the page. This is one of the "empty" tags.

 

References

HTML Element Reference W3 Schools

HTML Elements Reference Mozilla Developer Network

Oficial VS Code web siteMicrosoft

HTML Syntax ValidatorWorld Wide Web Consortium

Content CategoriesMozilla Developer Ntework

Phrasing Content vs. Flow ContentStack Overflow


Creative Commons License These lecture notes are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, by Brian Bird, revised Fall .