-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
889 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
source 'https://rubygems.org' | ||
gem 'rspec-html-matchers' | ||
gem 'css_parser' | ||
gem 'pry-nav' | ||
gem 'pry-stack_explorer' | ||
gem 'pry-stack_explorer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
### Objectives | ||
|
||
After this exercise, you should be able to: | ||
|
||
- Repeat the paragraph tag multiple times in a document | ||
|
||
### Example | ||
|
||
You can add multiple paragraphs to the same document. Let's translate *Hello World* into a few other languages. | ||
|
||
## Assignment | ||
### Exercise | ||
|
||
- Insert `English: ` before the text in your first paragraph. | ||
- Create three additional paragraphs with this text: | ||
- Create three additional paragraphs: | ||
- `Hawaiian: Aloha Houna` | ||
- `Luxembourgish: Moien Welt` | ||
- `Swahili: Salamu Dunia` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
### Objectives | ||
|
||
After this exercise, you should be able to: | ||
|
||
- Identify the HTML header tag | ||
- Use an HTML header tag in a document | ||
- Understand when not to use `<h1>` tags | ||
|
||
### Example | ||
|
||
Not all text is *paragraph* text. Documents often have headings. Headings are awesome! | ||
|
||
When writing headings, instead of using `<p>`, you can use `<h1>` through `<h6>`. | ||
When writing headings, instead of using `<p>` (and `</p>`), you can use `<h1>` through `<h6>`. | ||
|
||
- `<h1>`: most important. | ||
- `<h6>`: least important. | ||
|
||
## Assignment | ||
`<h1>`s should also only exist once on a page, while other tags can be used multiple times. For example, on a newspaper, "The New York Times" is in large letters on the front page. This is analogous to the `<h1>`. | ||
|
||
### Exercise | ||
|
||
- Add an `<h1>` tag at the top of your document with the title `Hello World Translations`. | ||
- Add an `<h1>` tag at the top of your document with the title `Hello World Translations`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
### Objectives | ||
|
||
After this exercise, you should be able to: | ||
|
||
- Identify the `<html>` and `<body>` tags | ||
- Describe which of these tags comes first | ||
- Describe why these tags are important | ||
|
||
### Example | ||
|
||
The text we've added is the main content of the HTML document. This main content is called the document's *body*, and it should be surrounded by `<body>` tags. | ||
|
||
The document's body is one part of an HTML document. (We'll get to the other part — the document's *head* — later.) The `<body>` tags should be surrounded by `<html>` tags. | ||
The document's body is one part of an HTML document. (We'll get to the other part — the document's *head* — later.) The `<body>` tags should be surrounded by `<html>` tags like this: | ||
|
||
```html | ||
<html> | ||
<body> | ||
<p>Some content goes here.</p> | ||
</body> | ||
</html> | ||
``` | ||
|
||
It may seem a bit verbose, but these strict formatting rules help web browsers display your document properly. | ||
It may seem a bit verbose, but these strict formatting rules help web browsers display your document properly. Without them, browsers might display your content incorrectly, more slowly, or not at all. | ||
|
||
## Assignment | ||
### Exercise | ||
|
||
- Surround our document so far with `<body>` tags. | ||
- Surround *those* tags with `<html>` tags. | ||
- Correctly place `<html>` and `<body>` tags around our document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
### Objectives | ||
|
||
After this exercise, you should be able to: | ||
|
||
- Recognize a CSS rule set | ||
- Explain the difference between HTML and CSS | ||
- List the elements of a CSS rule set | ||
- State an example of a CSS rule set | ||
- Understand and implement the `<style>` tag | ||
|
||
### Example | ||
|
||
We use HTML to describe the meaning and hierarchy of our content, but it doesn't say much about how that content should look. | ||
|
||
CSS is a separate language that describes the *presentation* of this content. | ||
|
||
CSS works by applying a list of "rules" with style information to a page. Together, these rules are called a "rule set". Here's an example: | ||
|
||
``` | ||
h1 { | ||
color: aqua; | ||
text-align: center; | ||
} | ||
``` | ||
|
||
In this example: | ||
|
||
- `h1` is a "selector" (more on that later) | ||
- `color` and `text-align` are "properties" | ||
- `aqua` and `center` are "values" | ||
|
||
Together, one selector and one or more property/value pairs make up a "rule set". | ||
|
||
Try adding this CSS to your `index.html` file. It goes inside `<style>` tags within your `<head>` tags: | ||
|
||
``` | ||
<head> | ||
<title>Hello World Translations</title> | ||
<style> | ||
h1 { | ||
color: aqua; | ||
text-align: center; | ||
} | ||
</style> | ||
</head> | ||
``` | ||
|
||
Notice how the selector `h1` corresponds to the `<h1>` HTML tag. | ||
|
||
Reload the page, and the header will appear in a soothing aqua color, centered on the page. | ||
|
||
### Exercise | ||
|
||
Let's spruce things up a bit. | ||
|
||
- Open the [CSS Reference](http://www.w3schools.com/cssref/) in a new tab. | ||
|
||
> For each part of the assignment, review the CSS Reference and experiment with different options. | ||
> | ||
> You may encounter terms you're not familiar with, like *sans serif*, *margin*, and *pixel* (px for short). These terms are defined in the CSS Reference. | ||
- Using the `body` selector, create some general styles: | ||
- Set `background-color` to `black`. | ||
- Set `font-family` to `sans-serif`. | ||
- Set `color` to `white`. | ||
- Using the `a` selector, set the `color` of links to `hotpink`. | ||
- Center the logo image by making the left and right margins equal. (You'll learn more about margins later.) Using the `img` selector: | ||
- Set `display` to `block`. | ||
- Set both `margin-left` and `margin-right` to `auto`. | ||
- Draw attention to the table headers by using the `th` selector to set `border` to `2px solid white`. | ||
|
||
> This is called a *shorthand property* because it sets multiple values at once. Review the [CSS border Property](http://www.w3schools.com/cssref/pr_border.asp) reference to learn more. | ||
For the final part of the assignment, you'll apply rules to *both* the `table` and `td` selectors, like so: | ||
|
||
```css | ||
table, td { | ||
… | ||
} | ||
``` | ||
|
||
- Add additional styling to `table` and `td`: | ||
- Set `border` to `1px solid gray`. | ||
- Set `border-collapse` to `collapse`. | ||
- Set `padding` to `10px`. | ||
|
||
Before submitting this assignment, experiment with different values to observe their effects. |
Oops, something went wrong.