You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/use-css-styles/includes/3-discover-more-css.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ As with any computer language, CSS supports comments. To comment in a section of
6
6
7
7
> [!IMPORTANT]
8
8
> CSS comments are public, and accessible by both the browser and users of your website. **Do not** store sensitive information in comments.
9
-
>
9
+
>
10
10
> CSS comments are formatted differently from HTML comments. Comments in HTML use the `<!--comment-->` syntax.
11
11
12
-
## Setting Fonts
12
+
## Setting fonts
13
13
14
14
You can use CSS to tell the browser what font you want to use for specific text. Sometimes you want to use Arial for readability or something fancier for style. The following image shows some text in Arial and other text in a font called "Impact."
15
15
@@ -19,18 +19,18 @@ The most common option for setting the font to use on a page is `font-family`. `
19
19
20
20
You can also use other options, such as the style, weight, and decoration. `font-style` is used to italicize text by setting the value to `italic`. `font-weight` supports different bold settings, with `bold` being the most common. And finally, `text-decoration` is used to `underline`, `overline`, or `line-through` text.
21
21
22
-
| CSS | Result |
23
-
| -----------------------------|----------- |
24
-
|`font-weight: bold;`|**Demo**|
25
-
|`font-style: italic;`|*Demo*|
22
+
| CSS | Result|
23
+
| --------------------------------|-------- |
24
+
|`font-weight: bold;`|**Demo**|
25
+
|`font-style: italic;`|*Demo*|
26
26
|`text-decoration: line-through;`|~~Demo~~|
27
27
28
28
`text-decoration` can feel different from the other options used to modify a font's display. The key difference is that `text-decoration` is used to apply style around or on the text but doesn't modify the actual font itself. Bold and italics are modifying the font.
29
29
30
30
> [!NOTE]
31
31
> Using underline on a webpage should typically be avoided because the text can appear to be a hyperlink.
32
32
33
-
## Sizing Fonts
33
+
## Sizing fonts
34
34
35
35
The `font-size` allows you to indicate the font size you wish to use. CSS offers the ability to use absolute or relative sizing. Absolute sizing is typically set in pixels and always use the specified size. Relative sizing can be based on the default size for the browser and measured in percent or based on the sizing of the reference element.
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/use-css-styles/includes/4-exercise-css-concepts.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,33 +2,33 @@ You want to begin styling your resume web page. You start by selecting the font
2
2
3
3
This module uses [vscode.dev](https://vscode.dev/) - a web-based version of Visual Studio Code and [CodeSwing](https://marketplace.visualstudio.com/items?itemName=codespaces-Contrib.codeswing). These tools help streamline the development process. No local installation is required to complete the exercises that follow.
4
4
5
-
## Create a Project
5
+
## Create a project
6
6
7
7
You start by creating a folder, setting up your tooling, and creating a "swing" using CodeSwing in vscode.dev. A swing will automatically display the results of your code in vscode.dev. Using Microsoft Visual Studio Code with CodeSwing allows you to quickly make modifications with a preview of updates happening in real time.
8
8
9
9
1. Create a folder on your desktop named **resume**.
10
-
1. Open [vscode.dev](https://vscode.dev).
11
-
1. Select **Open Folder**.
12
-
1. Navigate to the **resume** folder you created earlier and select **Select Folder**.
13
-
1. When prompted to **Let site view files**, select **View Files**.
14
-
1. Select the **Extensions** button.
10
+
2. Open [vscode.dev](https://vscode.dev).
11
+
3. Select **Open Folder**.
12
+
4. Navigate to the **resume** folder you created earlier and select **Select Folder**.
13
+
5. When prompted to **Let site view files**, select **View Files**.
14
+
6. Select the **Extensions** button.
15
15
>:::image type="content" source="../media/extensions.png" alt-text="Screenshot of Visual Studio extensions button.":::
16
-
1. In the **Search Extensions in Marketplace** text box, type **CodeSwing**.
17
-
1. Select **Install** to install **CodeSwing**.
18
-
1. Open the Command Palette by selecting **Ctrl+Shift+P** or **Cmd-Shift-P** on a Mac.
19
-
1. Type **CodeSwing** in the Command Palette and select **CodeSwing: New Swing in Directory**.
20
-
1. Select **Select Folder** to use the current directory (which is the one you created in a prior step).
21
-
1. Select **Basic: HTML/CSS/JavaScript**.
22
-
1. If prompted to **Save changes to resume**, select **Save changes**.
23
-
1. Select the **x** next to **script.js** inside vscode.dev to close the JavaScript file as you don't use this file during the exercise.
16
+
7. In the **Search Extensions in Marketplace** text box, type **CodeSwing**.
17
+
8. Select **Install** to install **CodeSwing**.
18
+
9. Open the Command Palette by selecting **Ctrl+Shift+P** or **Cmd-Shift-P** on a Mac.
19
+
10. Type **CodeSwing** in the Command Palette and select **CodeSwing: New Swing in Directory**.
20
+
11. Select **Select Folder** to use the current directory (which is the one you created in a prior step).
21
+
12. Select **Basic: HTML/CSS/JavaScript**.
22
+
13. If prompted to **Save changes to resume**, select **Save changes**.
23
+
14. Select the **x** next to **script.js** inside vscode.dev to close the JavaScript file as you don't use this file during the exercise.
24
24
25
25
Visual Studio Code creates two sections side by side. The left will be your editors, where you can enter your HTML and CSS. The right behaves like a browser, displaying the results of your code.
26
26
27
27
## Create the HTML
28
28
29
29
You use existing HTML to allow us to focus solely on the CSS. The HTML includes the `link` element to reference the CSS file.
30
30
31
-
1. Copy the following HTML into the window titled **index.html**:
31
+
- Copy the following HTML into the window titled **index.html**:
32
32
33
33
```html
34
34
<html>
@@ -72,7 +72,7 @@ You use existing HTML to allow us to focus solely on the CSS. The HTML includes
72
72
</html>
73
73
```
74
74
75
-
## Set Font Type and Size
75
+
## Set font type and size
76
76
77
77
By default, most browsers use a serif font such as Times New Roman. You want to set the page default to a more popular font. Additionally, you want to set the size of the font for the page and various headers.
78
78
@@ -87,8 +87,8 @@ By default, most browsers use a serif font such as Times New Roman. You want to
87
87
88
88
You're using the `html` element to update the root font and sizing. With the `html` element allows you to use `rem` sizing.
89
89
90
-
1. Notice the page automatically updates with the changes.
91
-
1. Add the following CSS code to the end of **style.css** to set the sizes for `h1` through `h4`.
90
+
2. Notice the page automatically updates with the changes.
91
+
3. Add the following CSS code to the end of **style.css** to set the sizes for `h1` through `h4`.
92
92
93
93
```css
94
94
h1 {
@@ -110,10 +110,10 @@ By default, most browsers use a serif font such as Times New Roman. You want to
110
110
111
111
`rem` is based on the root size, which is 14 pixels. As an example, this CSS sets the size of `h1` to 22.4 pixels.
112
112
113
-
1. The page is automatically updated in vscode.dev.
114
-
1. Leave the window open as you'll use it in the next exercise.
113
+
4. The page is automatically updated in vscode.dev.
114
+
5. Leave the window open as you'll use it in the next exercise.
115
115
116
-
## Result and Next Steps
116
+
## Result and next steps
117
117
118
118
The following screenshot is the result of the CSS you applied in this exercise. If you wish to experiment with different fonts and sizes, you can modify the CSS as you wish.
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/use-css-styles/includes/5-inspect-selectors.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ There are three core types of selectors:
7
7
8
8
By using these selectors, you can apply styles to many elements or a few.
9
9
10
-
## Element Selectors
10
+
## Element selectors
11
11
12
12
An element selector applies to all elements with that tag. Any HTML element can be used as an element selector. Using `h1` enables you to modify all `h1` elements on the page.
13
13
@@ -17,7 +17,7 @@ h1 {
17
17
}
18
18
```
19
19
20
-
## Class Selectors
20
+
## Class selectors
21
21
22
22
All HTML elements enable you to add a `class` attribute. `class` is used to group elements together and enable you to mark them for applying CSS settings.
23
23
@@ -66,18 +66,18 @@ a:hover {
66
66
67
67
Some of the most common pseudo-classes are listed in the following table:
|`hover`| User is hovering their cursor over an item |
72
+
|`visited`| A link that was previously clicked |
73
+
|`link`| An unvisited link |
74
74
|`first-child`| The first child matching the selector in a hierarchy |
75
-
|`last-child`| The last child matching the selector in a hierarchy |
75
+
|`last-child`| The last child matching the selector in a hierarchy |
76
76
77
77
> [!IMPORTANT]
78
78
> Using pseudo-elements and CSS, you can remove the underline from hyperlinks. As a general rule, it's best to leave the underline for accessibility purposes. The underlined text allows a user to quickly identify links on a page.
79
79
80
-
## ID Selectors
80
+
## ID selectors
81
81
82
82
Similar to classes, an ID allows you to apply a style to an element. But, while a class can be applied to multiple elements, an ID must be unique and refer to only one element.
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/use-css-styles/includes/6-exercise-selectors.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,33 +2,33 @@ In the prior exercise, you applied style to elements such as `html` and `h1`. Yo
2
2
3
3
In this exercise, you set the style for the social media and experience sections and links on the page.
4
4
5
-
## Applying Style to Classes and IDs
5
+
## Applying style to classes and IDs
6
6
7
7
You start by setting the style for the social media and experience sections.
8
8
9
9
1. Return to the vscode.dev window you used in the previous exercise.
10
-
1. Inside **index.html**, notice the `section` element with the ID of **social-media** at line 10; you apply style to this section to set the color to blue.
11
-
1. At the end of **style.css**, add the following CSS to set the color for the **social-media** element:
10
+
2. Inside **index.html**, notice the `section` element with the ID of **social-media** at line 10; you apply style to this section to set the color to blue.
11
+
3. At the end of **style.css**, add the following CSS to set the color for the **social-media** element:
12
12
13
13
```css
14
14
#social-media {
15
15
color: blue;
16
16
}
17
17
```
18
18
19
-
1. The page updates, setting the content in the social media section to blue.
20
-
1. Inside **index.html**, notice the two sections at lines 28 and 32 with the class **experience**; you apply style to these sections to italicize the font.
21
-
1. At the end of **style.css**, add the following CSS to modify the font for the elements with the **experience** class:
19
+
4. The page updates, setting the content in the social media section to blue.
20
+
5. Inside **index.html**, notice the two sections at lines 28 and 32 with the class **experience**; you apply style to these sections to italicize the font.
21
+
6. At the end of **style.css**, add the following CSS to modify the font for the elements with the **experience** class:
22
22
23
23
```css
24
24
.experience {
25
25
font-style: italic;
26
26
}
27
27
```
28
28
29
-
1. The page updates, setting the font inside experience to italicized.
29
+
7. The page updates, setting the font inside experience to italicized.
30
30
31
-
## Using Pseudo-classes to SetLinkStyle
31
+
## Using pseudo-classes to setlinkstyle
32
32
33
33
Many web developers change the color and style of hyperlinks on a page. You set the color for links to be green and highlight links when a user hovers over them.
34
34
@@ -44,16 +44,16 @@ Many web developers change the color and style of hyperlinks on a page. You set
44
44
}
45
45
```
46
46
47
-
1. The page updates to show links as green.
48
-
1. Add the following CSS to the end of **style.css** to highlight links as they're being hovered over:
47
+
2. The page updates to show links as green.
48
+
3. Add the following CSS to the end of **style.css** to highlight links as they're being hovered over:
49
49
50
50
```css
51
51
a:hover {
52
52
background-color: yellow;
53
53
}
54
54
```
55
55
56
-
1. Hover over the links on the page and notice the links are highlighted.
56
+
4. Hover over the links on the page and notice the links are highlighted.
0 commit comments