class: middle center # ~ HTML Recap ~ --- class: middle # comments It can be really helpful to leave notes to yourself about what elements are, or how they work, for later reference.
A great habit to get into! ```html
My Page
``` Comments are made by starting with `` **note:** comments will be visible to anyone viewing the source of your html ; ~ ) --- class: middle # html tags As you'll recall, html tags are designated with brackets wrapping a tag name: ![html tag](assets/html-tag.png) The closing tag is prefaced with a `/` slash to indicate the tag is ending. **note:** There are a few special "void" elements like an `
` tag that don't require a closing tag since they can't contain any content.. --- class: middle ## `block` and `inline` tags There are two primary types of interaction for tags to keep in mind. ### block tags Things like `div`, `p`, `section` etc.. `block tags` will take up the full width of the container, pushing other elements to be below them. You can also set additional css attributes on them like `width` and `height`. ### inline tags Are more often used within content, like: `span`, `a`, `strong` and other formatting tags that will flow with content instead of breaking it. --- class: middle ## the box model Html elements are represented as a boxes, and these boxes have several properties you can manipulate with css. The `padding`, `margin`, and `border` control how these boxes interact with neighboring elements. ![box model](assets/box-model.png) --- class: middle ## semantic html Using tags that can indicate what kind of content they contain can be a useful way to improve the accessibility and parse-ability of your pages. These tags that can confer extra meaning are called semantic tags. --- class: middle + **core semantic elements**: `h1`-`h6`, `p`, `main`, `header`, `footer`, `nav`, `article`, `section`, `aside`, `blockquote`, `img`, `video`, `figure`... ```html
The heading tag
``` + **general elements**: `div`, `span` + **lists**: ul, ol, dl ```html
Types of Lists:
ul tag
unordered lists (e.g. ยท bulleted lists)
ol tag
ordered lists (e.g. 1) 2) 3))
dl tag
the description list list.. meta
``` --- class: middle ## links You can use anchor `
` tags to link to outside pages or to an element on the same page: ```html
Go to page two
Go to the footnote
...
contact me!
Give me a call! ๐
``` --- class: middle ## relative vs absolute links There are two ways to link to outside resources: `relative` and `absolute` links. --- #### absolute Absolute links point to the exact directory or location of the page you are linking to, e.g. ```html
homepage
Youtube
``` #### relative Relative links point to another page in relation to the current url: ```html
homepage
homepage
``` It's generally better to use absolute urls to ensure links wont break if the url setup changes ??? remember that the id's of elements must be unique! --- class: middle ## image, video, and audio tags There are special tags to incorporate images and other media types on your page: ```html
``` or video: ```html
Sorry, it appears your browser doesn't support video.
``` or audio: ```html
``` ??? don't forget alt tags! they important for both seo and accessibility --- class: middle ## putting it all together ```html
```