-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(learn-html): add exercise to styles lesson #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,10 +124,10 @@ For example: | |
|
|
||
| Exercise | ||
| -------- | ||
| 1. Change the `font-family` of `Paragraph 1` to `sans-serif` using the Inline method. | ||
| 2. Change the `font-family` of `Paragraph 2` to `monospace` using a CSS `<style>` tag and a CSS selector. | ||
| 3. Change the `font-family` of `Paragraph 3` to `serif` using JavaScript programmatically. | ||
|
|
||
| This page does not have an exercise yet. You are welcome to contribute one by sending me a pull request: | ||
|
|
||
| [[https://github.com/ronreiter/interactive-tutorials]] | ||
|
|
||
|
|
||
| Tutorial Code | ||
|
|
@@ -138,6 +138,15 @@ Tutorial Code | |
| <head> | ||
| </head> | ||
| <body> | ||
| <p> | ||
| Paragraph 1. | ||
| </p> | ||
| <p class="p2"> | ||
| Paragraph 2. | ||
| </p> | ||
| <p id="p3"> | ||
| Paragraph 3. | ||
| </p> | ||
| </body> | ||
| </html> | ||
|
|
||
|
|
@@ -147,11 +156,27 @@ Expected Output | |
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Hello, World!</title> | ||
| <style> | ||
| .p2 { | ||
| font-family: monospace; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <p>Hello, World!</p> | ||
| <p style="font-family: sans-serif"> | ||
| Paragraph 1. | ||
| </p> | ||
| <p class="p2"> | ||
| Paragraph 2. | ||
| </p> | ||
| <p id="p3"> | ||
| Paragraph 3. | ||
| </p> | ||
| </body> | ||
| <script> | ||
| var seriftext = document.getElementById("p3"); | ||
| seriftext.style.fontFamily = "serif"; | ||
|
Comment on lines
+176
to
+178
|
||
| </script> | ||
| </html> | ||
|
|
||
| Solution | ||
|
|
@@ -160,9 +185,25 @@ Solution | |
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Hello, World!</title> | ||
| <style> | ||
| .p2 { | ||
| font-family: monospace; | ||
| } | ||
| </style> | ||
|
Comment on lines
+188
to
+192
|
||
| </head> | ||
| <body> | ||
| <p>Hello, World!</p> | ||
| <p style="font-family: sans-serif"> | ||
| Paragraph 1. | ||
| </p> | ||
| <p class="p2"> | ||
| Paragraph 2. | ||
| </p> | ||
| <p id="p3"> | ||
| Paragraph 3. | ||
| </p> | ||
| </body> | ||
| </html> | ||
| <script> | ||
| var seriftext = document.getElementById("p3"); | ||
| seriftext.style.fontFamily = "serif"; | ||
|
Comment on lines
+205
to
+207
|
||
| </script> | ||
| </html> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most lessons keep the standard
<title>Hello, World!</title>in the Expected Output template (and this file previously did as well). Consider keeping the<title>alongside the new<style>block for consistency across tutorials.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback