Skip to content

Commit 5499800

Browse files
authored
fix(curriculum): add interactive examples to default browser styles (freeCodeCamp#62762)
1 parent 2d574da commit 5499800

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

curriculum/challenges/english/blocks/lecture-what-is-css/672acbdd06b44c4cd3bf8713.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ challengeType: 19
55
dashedName: what-are-some-default-browser-styles-applied-to-html
66
---
77

8-
# --description--
8+
# --interactive--
99

1010
When you start working with HTML and CSS, you'll notice that some styles are applied to your web pages even before you write any CSS. These styles are called "default browser styles" or "user-agent styles".
1111

@@ -23,6 +23,8 @@ These heading tags help define the hierarchy and structure of your content.
2323

2424
The following example shows all six heading elements from `h1` to `h6`.
2525

26+
:::interactive_editor
27+
2628
```html
2729
<h1>Heading 1</h1>
2830
<h2>Heading 2</h2>
@@ -32,10 +34,14 @@ The following example shows all six heading elements from `h1` to `h6`.
3234
<h6>Heading 6</h6>
3335
```
3436

37+
:::
38+
3539
Another element with default styles is the `hr` element, which creates a horizontal rule often used to visually separate sections of content. Browsers generally apply a simple line style to this element.
3640

3741
To understand it better, let's look at this code example:
3842

43+
:::interactive_editor
44+
3945
```html
4046
<p>Paragraph 1</p>
4147
<p>Paragraph 2</p>
@@ -44,6 +50,8 @@ To understand it better, let's look at this code example:
4450
<p>Paragraph 4</p>
4551
```
4652

53+
:::
54+
4755
The horizontal rule appears as a thin line with spacing above and below the text to distinguish between sections of content.
4856

4957
Next, we will look at the `blockquote` element.
@@ -54,6 +62,8 @@ The indentation helps set blockquotes apart from the rest of the text, making it
5462

5563
Let's take a look at this code example:
5664

65+
:::interactive_editor
66+
5767
```html
5868
<p>Paragraph 1</p>
5969
<p>Paragraph 2</p>
@@ -62,12 +72,16 @@ Let's take a look at this code example:
6272
<p>Paragraph 4</p>
6373
```
6474

75+
:::
76+
6577
In the example above, the `blockquote` element will produce an indent on the text, applied by the default browser styles.
6678

6779
Another element with default styles is the anchor element (`<a>`), which is styled with a default blue color and underlining to make it recognizable as a link.
6880

6981
Let's take at look at the following HTML example:
7082

83+
:::interactive_editor
84+
7185
```html
7286
<p>Paragraph 1</p>
7387
<p>Paragraph 2</p>
@@ -76,6 +90,8 @@ Let's take at look at the following HTML example:
7690
<p>Paragraph 4</p>
7791
```
7892

93+
:::
94+
7995
The above code has four paragraph elements with an anchor element in the middle. The anchor element is styled in blue with an underline to show users to go to the freeCodeCamp learn page.
8096

8197
Finally, we'll look at the unordered and ordered list elements.
@@ -84,6 +100,8 @@ Browsers add basic formatting to lists, including indentation and bullets or num
84100

85101
Let's take a look at an example:
86102

103+
:::interactive_editor
104+
87105
```html
88106
<p>Sample Paragraph</p>
89107
<ol>
@@ -99,6 +117,8 @@ Let's take a look at an example:
99117
<p>Ending Paragraph</p>
100118
```
101119

120+
:::
121+
102122
In the above code example, we are using an unordered list and an ordered list. Both of these lists will be slightly indented to the right by default.
103123

104124
For all of these examples, you saw how the browser applied default spacing, varying font sizes, and weights to these HTML elements.

0 commit comments

Comments
 (0)