CIS195 Web Authoring 1: HTML
| Weeks 1-4 | Weeks 5-8 |
|---|---|
| 1. Intro to HTML | 5. Midterm, Layout with CSS |
| 2. More HTML, file paths | 6. HTML Tables |
| 3. Site structure and navigation | 7. HTML Forms |
| 4. Formatting with CSS | 8. Multimedia, Final |
| Weeks 1-5 | Weeks 6-10 |
|---|---|
| 1. Intro to HTML | 6. Layout with CSS |
| 2. More HTML, file paths | 7. HTML Tables |
| 3. Site structure and navigation | 8. HTML Forms |
| 4. Formatting with CSS, Midterm | 9. Multimedia, Final |
| 5. Project Propposal, Midtern | 10. Project Completion, Final |
[Topics by Week for the Ten-Week Term]
[TOC]
The position property specifies the positioning method used for an element:
static—not positioned in any special way. This is the default.
relative—sets position relative to it’s normal position.
fixed—sets position relative to the viewport (browser window). The position does not change as the page is scrolled.
absolute—sets position relative to the nearest positioned ancestor—which will be the body if no others have their position set.
sticky—sets position based on the browser window’s scroll position. As long as an element’s position is inside the window (viewport), its position setting is relative. But, when the pate is scrolled until the element is at the edge of the window, it sticks there.
After setting a position property, a distance can be set. Elements are positioned using the one of the following properties:
top—a positive number moves the top of the element down.
bottom—a positive number moves the bottom of the element up.
left—a positive number moves the left side of the element to the right.
right—a positive number moves the right side of the element to the left.
This example moves the image 100 pixels to the right and 50 pixels down:
img {
position: relative;
left: 100px;
top: 50px;
}
The overflow property specifies what should happen if content overflows an element’s content area. The values are:
Example:
div {
overflow: scroll;
}
The z-index property specifies the stack order of an element. The greater the stack order, the closer an is element is to the front.
This property only works for elements that have their position set.
There are two possible values:
Example:
img {
position: fixed;
left: 10px;
top: 10px;
z-index: -1;
}
Web Authoring Lecture Notes, written by Brian Bird in 2018 and revised by Brian Bird in 2020, are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.