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: Instructions/20480C_MOD10_LAB_MANUAL.md
+39-38Lines changed: 39 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
#### Scenario
6
6
7
-
Most conference attendees are expected to use a laptop to view the live version of the Contoso Conference website, but some may wish to print a hard copy of some of the information. Other attendees might use smartphones or other handheld devices to view the website. The different requirements and form factors of a printer or a handheld device compared to a laptop make it necessary for the user interface of the web application to detect device capabilities and adapt itself accordingly. For example, some website elements, such as the header, are not necessary for printing, while the smaller screens of smartphones are not ideal for viewing full-sized websites.
7
+
Most conference attendees are expected to use a laptop to view the live version of the Contoso Conference website, but some may wish to print a hard copy of some of the information. Other attendees might use smartphones or other handheld devices to view the website. The different requirements and form factors of a printer or a handheld device compared to a laptop make it necessary for the user interface of the web application to detect device capabilities and adapt itself accordingly. For example, some website elements, such as the header, are not necessary for printing, while the smaller screens of smartphones are not ideal for viewing full-sized websites.
In this exercise, you will add a style sheet for formatting web pages in a style suitable for printing. You will ensure that this style sheet is used only when a page is being printed.
23
+
In this exercise, you will add a style sheet for formatting web pages in a style suitable for printing. You will ensure that this style sheet is used only when a page is being printed.
24
24
25
-
In the style sheet, you will add rules to override the layout of the website, removing the header and footer, and reformatting the **About** page to display the information in a single wide column. To test the application, you will view the **About** page and verify that the print preview displays a correctly formatted version of the page.
25
+
In the style sheet, you will add rules to override the layout of the website, remove the header and footer, and reformat the **About** page to display the information in a single wide column. To test the application, you will view the **About** page and verify that the print preview displays a correctly formatted version of the page.
26
26
27
-
#### Task 1: Review the existing application.
27
+
#### Task 1: Review the existing application
28
28
29
-
1. Start Visual Studio and open the **ContosoConf.sln** solution in the **Allfiles\Mod10\Labfiles\Starter\Exercise 1** folder.
30
-
2. Run the application and view the **about.htm** page.
31
-
3. In Microsoft Edge, press F10 to display the menu bar
29
+
1. Start Microsoft Visual Studio, and then from the **Allfiles\Mod10\Labfiles\Starter\Exercise 1** folder, open the **ContosoConf.sln** solution.
30
+
2. Run the application, and then view the **about.htm** page.
31
+
3. In Microsoft Edge, press F10 to display the menu bar.
32
32
4. On the **File** menu, click **Print preview**. Notice that the print preview attempts to display the page header and that the text columns are too narrow.
33
33
34
34

@@ -37,22 +37,22 @@ In the style sheet, you will add rules to override the layout of the website, re
37
37
6. In Visual Studio, examine the about.htm page and verify that the **<nav>** element is marked with the **page-nav** class, the **<header>** element is marked with the **page-header** class, and the **<footer>** element is marked with the **page-footer** class, as follows:
38
38
```html
39
39
<navclass="page-nav">
40
-
40
+
41
41
<headerclass="page-header">
42
-
42
+
43
43
<footerclass="page-footer">
44
44
```
45
45
You will use these classes to style the elements when the page is printed.
46
46
47
-
#### Task 2: Create a style sheet for printing web pages.
47
+
#### Task 2: Create a style sheet for printing web pages
48
48
49
-
1. In the ContosoConf project, add a new style sheet named **print.css** to the **styles** folder.
50
-
- Use the **Add New Item** wizard and use the Style Sheet template on the **Web** tab.
51
-
2. In the **print.css** style sheet, delete the existing contents and add a CSS rule to hide the **nav** element that has the **page-nav** class, the **header** element that has the **page-header** class, and the **footer** element that has the **page-footer** class.
49
+
1. In the ContosoConf project, in the **styles** folder, add a new style sheet named **print.css**.
50
+
- Use the **Add New Item** wizard and the **Style Sheet** template on the **Web** tab.
51
+
2. In the **print.css** style sheet, delete the existing content, and then add a CSS rule to hide the **nav** element that has the **page-nav** class, the **header** element that has the **page-header** class, and the **footer** element that has the **page-footer** class.
52
52
- Set the **display** property of these elements to **none**.
53
-
3. Add a CSS rule for the **.container** class, which overrides the CSS from **site.css**.
53
+
3. Add a CSS rule for the **.container** class, which overrides the CSS from **site.css**.
54
54
- When printing, container elements should have no maximum width or padding.
55
-
4. The **about.css**style sheet in the **styles/pages**folder contains the following CSS rule to display the page text in columns.
55
+
4. In the **styles/pages**folder, the **about.css**style sheet contains the following CSS rule to display the page text in columns.
56
56
```css
57
57
.about > article > section {
58
58
text-align: justify;
@@ -62,75 +62,76 @@ You will use these classes to style the elements when the page is printed.
62
62
column-gap: 5rem; ;
63
63
}
64
64
```
65
-
In **print.css**, add a CSS rule that removes the columns, so that the text displays as a single block.
65
+
5.In **print.css**, add a CSS rule that removes the columns, so that the text displays as a single block.
66
66
- You only need to set the **column-count** property in this rule.
67
67
68
-
#### Task 3: Link the print style sheet to the About page.
68
+
#### Task 3: Link the print style sheet to the About page
69
69
70
-
1. Add a link to **print.css** in the **<head>** section of the **About** page, where indicated by the comment <!-- TODO: Add print.css <link> here -->. Set the **media** attribute of the link so that the style sheet is used only when printing.
70
+
- In the **About**page, in the **<head>** section, add a link to **print.css** where indicated by the comment <!-- TODO: Add print.css <link> here -->. Set the **media** attribute of the link so that the style sheet is used only when printing.
71
71
72
-
#### Task 4: Test the application.
72
+
#### Task 4: Test the application
73
73
74
-
1. Run the application and view the **About** page.
74
+
1. Run the application, and then view the **About** page.
75
75
2. Refresh the page to ensure that the most recent version of the **About** page is loaded.
76
-
3. In Microsoft Edge, open the **Print Preview** window and verify that the preview does not display the navigation, header, or footer, and that the text has no columns.
76
+
3. In Microsoft Edge, open the **Print Preview** window and verify that the preview does not display the navigation, header, or footer and that the text has no columns.
77
77
78
78

79
79
80
-
4. Close the **Print Preview** window and then close Microsoft Edge.
80
+
4. Close the **Print Preview** window, and then close Microsoft Edge.
81
81
82
-
>**Results:** After completing this exercise, you will have added a style sheet that implements a print-friendly format for web pages.
82
+
>**Results**: After completing this exercise, you will have added a style sheet that implements a print-friendly format for the web pages.
83
83
84
-
### Exercise 2: Adapting Page Layout to Fit Different Form Factors.
84
+
### Exercise 2: Adapting Page Layout to Fit Different Form Factors
85
85
86
86
#### Scenario
87
87
88
88
In this exercise, you will create a style sheet that enables the pages in the Contoso Conference website to adapt to different device form factors.
89
89
90
-
First, you will view the application running in a small window to simulate a small device, such as a smartphone. Then you will use CSS media queries to define rules that change the website layout to better suit small devices.
90
+
First, you will view the application running in a small window to simulate a small device, such as a smartphone. Then, you will use CSS media queries to define rules that change the website layout to better suit small devices.
91
91
Finally, you will run the application again and verify that the website layout adapts to large and small screen sizes.
92
92
93
-
#### Task 1: Simulate the web application running on a small device.
93
+
#### Task 1: Simulate the web application running on a small device
94
94
95
-
1. In Visual Studio, open the **ContosoConf** solution in the **Allfiles\Mod10\Labfiles\Starter\Exercise 2** folder.
96
-
2. Run the application and view the **index.htm** page.
95
+
1. In Visual Studio, from the **Allfiles\Mod10\Labfiles\Starter\Exercise 2** folder, open the **ContosoConf** solution.
96
+
2. Run the application, and then view the **index.htm** page.
97
97
3. Resize Microsoft Edge to **480 × 800**, approximating the form factor of a Windows Phone 8 device.
98
98
99
-
>**Note:** Use the F12 Developer Tools to change the size of the device viewing the website. The **Resize** command on the **Tools** menu enables you to change the size of the browser.
99
+
>**Note**: Use the F12 Developer Tools to change the size of the device viewing the website. The **Resize** command on the **Tools** menu enables you to change the size of the browser.
100
100
101
-
4. Notice that the website navigation bar does not fit on the screen and that the big **Register** link overlaps the header text.
101
+
4. Notice that the website navigation bar does not fit on the screen and that the big **Register** link overlaps the header text.
102
102
103
103

104
104
105
105
5. Close Microsoft Edge.
106
106
107
-
#### Task 2: Implement styles for hand-held devices and smartphones.
107
+
#### Task 2: Implement styles for hand-held devices and smartphones
108
108
109
-
1. Open the **mobile.css** style sheet in the styles **folder**. This style sheet is referenced in the **<head>** element of each page in the website. This style sheet is currently empty, but you will use it to specify the styles for hand-held devices and smartphones.
109
+
1. From the styles **folder**, open the **mobile.css** style sheet. This style sheet is referenced in the **<head>** element of each page in the website. This style sheet is currently empty, but you will use it to specify the styles for hand-held devices and smartphones.
110
110
2. Add a CSS media query that targets screens that are less than or equal to 480 pixels in width.
111
111
3. In the media query, add a rule for **nav.page-nav .container** that uses a flexbox to display the contents of the navigation bar, as follows:
112
-
```css
112
+
```
113
+
css
113
114
display: -ms-flexbox;
114
115
-ms-flex-wrap: wrap;
115
116
-ms-flex-pack: center;
116
117
```
117
118
4. Add another rule that hides the **:before** and **:after** pseudo elements of the **.active** navigation link.
118
119
- Set the **display** property to none.
119
120
5. Add another rule that sets a **.5rem** margin around each navigation link. This rule should also set a **1px** dotted border with the color **#3d3d3d** completely around the link, instead of just on the right.
120
-
6. The default layout of the website header is not suitable for screens less than 720 pixels wide. Add another media query to **mobile.css** that targets screen widths up to 720 pixels.
121
+
6. The default layout of the website header is not suitable for screens less than 720 pixels wide. Add another media query to **mobile.css** that targets screen widths up to 720 pixels.
121
122
7. In this media query, add rules that perform the following actions:
122
123
- Reduce the height of the page header (set the **height** to **auto**).
123
124
- Hide the large **Register** link in the page header.
124
125
- Reduce the **font-size** of the **<h1>** element in the page header to **3rem**.
125
126
126
-
#### Task 3: Test the application.
127
+
#### Task 3: Test the application
127
128
128
-
1. Run the application and view the **Home** page.
129
-
2. Use the F12 Developer Tools to resize Microsoft Edge to various sizes to test that the media queries adapt the user interface correctly.
129
+
1. Run the application, and then view the **Home** page.
130
+
2. To resize Microsoft Edge to various sizes to test that the media queries adapt the user interface correctly, use F12 Developer Tools.
130
131
- As a minimum, try the sizes 1280x1024 and 480x800.
131
132
3. Close Microsoft Edge.
132
133
133
-
>**Result:** After completing this exercise, you will have a website that adapts to different screen sizes.
134
+
>**Result**: After completing this exercise, you will have a website that adapts to different screen sizes.
0 commit comments