Skip to content

feat(learn-html): add exercise to styles lesson#873

Open
DHaytham wants to merge 1 commit intoronreiter:masterfrom
DHaytham:learn-html-add-exercise
Open

feat(learn-html): add exercise to styles lesson#873
DHaytham wants to merge 1 commit intoronreiter:masterfrom
DHaytham:learn-html-add-exercise

Conversation

@DHaytham
Copy link
Copy Markdown

Added a new Excersise for the styles page in learnhtml.org

Copilot AI review requested due to automatic review settings April 11, 2026 21:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an exercise to the Styles lesson to practice applying font-family via inline styles, an embedded stylesheet + selector, and JavaScript.

Changes:

  • Replaced the placeholder “no exercise yet” section with a 3-step exercise.
  • Updated the Tutorial Code to include three paragraphs (one per step).
  • Updated Expected Output and Solution to demonstrate inline CSS, a .p2 CSS rule, and programmatic styling for #p3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +127 to +129
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 the CSS Stylesheets and CSS selectors.
3. change the `font-family` of `Paragraph 3` to `serif` using JavaScript (programmatically).
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exercise instructions should match the terminology used earlier in the page and be consistently capitalized. Consider capitalizing the sentence starts ("Change...") and referring to the methods using the section names (e.g., "Inline" / "Using a CSS tag" or "embedded stylesheet") instead of "CSS Stylesheets" to avoid ambiguity.

Suggested change
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 the CSS Stylesheets and CSS selectors.
3. change the `font-family` of `Paragraph 3` to `serif` using JavaScript (programmatically).
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.

Copilot uses AI. Check for mistakes.
Comment on lines +141 to +149
<p>
Paragraph 1.
</p>
<p class="p2">
Paragraph 2.
</p>
<p id="p3">
Paragraph 3.
</p>
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML indentation in the "Tutorial Code" snippet is inconsistent (e.g., the <p> block isn’t aligned/indented under <body> and the closing </p> is out of alignment). Please re-indent this snippet to match the formatting used elsewhere in the tutorials (e.g., tutorials/learn-html.org/en/Fonts.md:19-25) and the indentation shown below in Expected Output/Solution.

Suggested change
<p>
Paragraph 1.
</p>
<p class="p2">
Paragraph 2.
</p>
<p id="p3">
Paragraph 3.
</p>
<p>
Paragraph 1.
</p>
<p class="p2">
Paragraph 2.
</p>
<p id="p3">
Paragraph 3.
</p>

Copilot uses AI. Check for mistakes.
Comment on lines 158 to +162
<head>
<title>Hello, World!</title>
<style>
.p2 {
font-family: monospace;
}
Copy link

Copilot AI Apr 11, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +176 to +178
<script>
var seriftext = document.getElementById("p3");
seriftext.style.fontFamily = "serif";
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name seriftext doesn’t follow the camelCase style used elsewhere in this tutorial (e.g., sansSerifText above). Consider renaming it to something like serifText / serifTextEl for readability.

Copilot uses AI. Check for mistakes.
Comment on lines +188 to +192
<style>
.p2 {
font-family: monospace;
}
</style>
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other tutorials’ Solution templates, consider keeping the standard <title>Hello, World!</title> in the <head> in addition to the new <style> block.

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +207
<script>
var seriftext = document.getElementById("p3");
seriftext.style.fontFamily = "serif";
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: seriftext would be clearer as camelCase (serifText / serifTextEl) to match naming used elsewhere in the tutorial.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants