|
1 | | -# Module 10: Implementing an Adaptive User Interface. |
| 1 | +# Module 10: Implementing an Adaptive User Interface |
2 | 2 |
|
3 | | -# Lab: Implementing an Adaptive User Interface. |
| 3 | +# Lab: Implementing an Adaptive User Interface |
4 | 4 |
|
5 | 5 | ### Lab Setup |
6 | 6 |
|
7 | 7 | ### Preparation Steps |
8 | 8 |
|
9 | | -1. Ensure that you have cloned the 20480C directory from GitHub. It contains the code segments for this course's labs and demos. https://github.com/MicrosoftLearning/20480-Programming-in-HTML5-with-JavaScript-and-CSS3/tree/master/Allfiles. |
10 | | -2. Before you start this exercise, make sure that you have disabled caching in Microsoft Edge, as follows: |
11 | | - - Open **Microsoft Edge**. |
12 | | - - Press **F12**. |
| 9 | +1. Ensure that you have cloned the 20480C directory from GitHub (**https://github.com/MicrosoftLearning/20480-Programming-in-HTML5-with-JavaScript-and-CSS3/tree/master/Allfiles**). It contains the code segments for the labs and demos in this course. |
| 10 | +2. Before you start this exercise, make sure that you have disabled caching in Microsoft Edge. To do this: |
| 11 | + - Open Microsoft Edge. |
| 12 | + - Press F12. |
13 | 13 | - Click the **Network** tab. |
14 | | - - Click **Allways refresh from server** |
| 14 | + - Click **Always refresh from server**. |
15 | 15 |
|
16 | | -### Exercise 1: Creating a Print-Friendly Style Sheet. |
| 16 | +### Exercise 1: Creating a Print-Friendly Style Sheet |
17 | 17 |
|
18 | | -#### Task 1: Review the existing application. |
| 18 | +#### Task 1: Review the existing application |
19 | 19 |
|
20 | | -1. Open **Visual Studio 2017**. |
21 | | -2. In Visual Studio, on the **File** menu, point to **Open**, and then click **Project/Solution**. |
| 20 | +1. Open Microsoft Visual Studio 2017. |
| 21 | +2. In Visual Studio, on the **File** menu, point to **Open**, and then select **Project/Solution**. |
22 | 22 | 3. In the **Open Project** dialog box, browse to **Allfiles\Mod10\Labfiles\Starter\Exercise 1**, click **ContosoConf.sln**, and then click **Open**. |
23 | | -4. In Visual Studio, in Solution Explorer, expand the **ContosoConf** project, and then double-click **about.htm**. |
| 23 | +4. In Visual Studio, in **Solution Explorer**, expand the **ContosoConf** project, and then double-click **about.htm**. |
24 | 24 | 5. On the **Debug** menu, click **Start Without Debugging**. |
25 | | -6. In Microsoft Edge, if the message **Intranet settings are turned off by default** appears, click **Don’t show this message again**. |
26 | | -7. Press F10 to display the menu bar |
| 25 | +6. In Microsoft Edge, if the **Intranet settings are turned off by default** message appears, click **Don’t show this message again**. |
| 26 | +7. To display the menu bar, press F10. |
27 | 27 | 8. On the **File** menu, click **Print preview**. |
28 | 28 | 9. In the **Print Preview** window, verify that the preview looks like the following image: |
29 | 29 |
|
30 | 30 |  |
31 | 31 |
|
32 | 32 | 10. Close the **Print Preview** window. |
33 | 33 | 11. Close Microsoft Edge. |
34 | | -12. In Visual Studio, in the Solution Explorer window, double-click **about.htm**. |
| 34 | +12. In Visual Studio, in **Solution Explorer**, double-click **about.htm**. |
35 | 35 | 13. Verify that the file contains the following HTML markup: |
36 | 36 | ```html |
37 | 37 | <nav class="page-nav"> |
|
41 | 41 | <footer class="page-footer"> |
42 | 42 | ``` |
43 | 43 |
|
44 | | -#### Task 2: Create a style sheet for printing web pages. |
| 44 | +#### Task 2: Create a style sheet for printing web pages |
45 | 45 |
|
46 | | -1. In Visual Studio, in Solution Explorer, click the **styles** folder. |
| 46 | +1. In Visual Studio, in **Solution Explorer**, click the **styles** folder. |
47 | 47 | 2. On the **Project** menu, click **Add New Item**. |
48 | 48 | 3. In the **Add New Item - ContosoConf** dialog box, in the left pane, expand the **Visual C#** node, and then click **Web**. |
49 | 49 | 4. In the middle pane, click **Style Sheet**. |
50 | 50 | 5. In the **Name** box, type **print.css**. |
51 | 51 | 6. Click **Add**. |
52 | | -7. In **print.css**, delete the existing file contents. |
| 52 | +7. In **print.css**, delete the existing file content. |
53 | 53 | 8. Add the following CSS: |
54 | 54 | ```css |
55 | 55 | nav.page-nav, |
|
63 | 63 | max-width: none; |
64 | 64 | } |
65 | 65 | ``` |
66 | | -9. In **print.css**, at the end of the file, add the following CSS: |
| 66 | +9. In **print.css**, at the end of the file, add the following CSS: |
67 | 67 | ```css |
68 | 68 | .about > article > section { |
69 | 69 | column-count: 1; |
70 | 70 | } |
71 | 71 | ``` |
72 | 72 |
|
73 | | -#### Task 3: Link the print style sheet to the About page. |
| 73 | +#### Task 3: Link the print style sheet to the About page |
74 | 74 |
|
75 | | -1. In Solution Explorer, double-click **about.htm**. |
| 75 | +1. In **Solution Explorer**, double-click **about.htm**. |
76 | 76 | 2. Find the following comment: |
77 | 77 | ```html |
78 | 78 | <!-- TODO: Add print.css <link> here --> |
|
82 | 82 | <link href="/styles/print.css" media="print" rel="stylesheet" type="text/css" /> |
83 | 83 | ``` |
84 | 84 |
|
85 | | -#### Task 4: Test the application. |
| 85 | +#### Task 4: Test the application |
86 | 86 |
|
87 | 87 | 1. On the **Debug** menu, click **Start Without Debugging**. |
88 | | -2. In Microsoft Edge, press F5 to refresh the page. |
89 | | -3. Press F10 to display the menu bar. |
| 88 | +2. To refresh the page, in Microsoft Edge, press F5. |
| 89 | +3. To display the menu bar, press F10. |
90 | 90 | 4. On the **File** menu, click **Print preview**. |
91 | 91 | 5. Verify that the **Print Preview** window displays the following image: |
92 | 92 |
|
|
95 | 95 | 6. Close the **Print Preview** window. |
96 | 96 | 7. Close Microsoft Edge. |
97 | 97 |
|
98 | | ->**Results:** After completing this exercise, you will have added a style sheet that implements a print-friendly format for web pages. |
| 98 | +>**Results**: After completing this exercise, you will have added a style sheet that implements a print-friendly format for web pages. |
99 | 99 |
|
100 | | -### Exercise 2: Adapting Page Layout to Fit Different Form Factors. |
| 100 | +### Exercise 2: Adapting Page Layout to Fit Different Form Factors |
101 | 101 |
|
102 | | -#### Task 1: Simulate the web application running on a small device. |
| 102 | +#### Task 1: Simulate the web application running on a small device |
103 | 103 |
|
104 | | -1. In Visual Studio, on the **File** menu, point to **Open**, and then click **Project/Solution**. |
| 104 | +1. In Visual Studio, on the **File** menu, point to **Open**, and then select **Project/Solution**. |
105 | 105 | 2. In the **Open Project** dialog box, browse to **Allfiles\Mod10\Labfiles\Starter\Exercise 2**, click **ContosoConf.sln**, and then click **Open**. |
106 | | -3. In Solution Explorer, expand the **ContosoConf** project, and then double-click **index.htm**. |
| 106 | +3. In **Solution Explorer**, expand the **ContosoConf** project, and then double-click **index.htm**. |
107 | 107 | 4. On the **Debug** menu, click **Start Without Debugging**. |
108 | 108 | 5. In Microsoft Edge, press F12. |
109 | | -6. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then click **480x800**. |
| 109 | +6. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then select **480x800**. |
110 | 110 | 7. Press F12. |
111 | 111 | 8. Verify that the **Home** page looks similar to the following image: |
112 | 112 |
|
113 | 113 |  |
114 | 114 |
|
115 | | -9. Close Microsoft Edge. |
| 115 | +9. Close Microsoft Edge. |
116 | 116 |
|
117 | | -#### Task 2: Implement styles for hand-held devices and smartphones. |
| 117 | +#### Task 2: Implement styles for hand-held devices and smartphones |
118 | 118 |
|
119 | | -1. In Solution Explorer, expand the **styles** folder, and then double-click **mobile.css**. |
| 119 | +1. In **Solution Explorer**, expand the **styles** folder, and then double-click **mobile.css**. |
120 | 120 | 2. Add the following CSS to the file: |
121 | 121 | ```css |
122 | 122 | @media screen and (max-width: 480px) { |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | ``` |
145 | | -4. Add the following CSS to the end of the file: |
| 145 | +4. Add the following CSS to the end of the file: |
146 | 146 | ```css |
147 | 147 | @media screen and (max-width: 720px) { |
148 | 148 | header.page-header { |
|
159 | 159 | } |
160 | 160 | ``` |
161 | 161 |
|
162 | | -#### Task 3: Test the application. |
| 162 | +#### Task 3: Test the application |
163 | 163 |
|
164 | | -1. In Solution Explorer, double-click **index.htm**. |
| 164 | +1. In **Solution Explorer**, double-click **index.htm**. |
165 | 165 | 2. On the **Debug** menu, click **Start Without Debugging**. |
166 | 166 | 3. In Microsoft Edge, press F12. |
167 | | -4. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then click **1280×1024**. |
| 167 | +4. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then select **1280×1024**. |
168 | 168 | 5. Press F12. |
169 | 169 | 6. Verify that the **Home** page is displayed correctly on the desktop. |
170 | 170 |
|
171 | 171 |  |
172 | 172 |
|
173 | | -7. Press F12. |
174 | | -8. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then click **480×800**. |
| 173 | +7. Press F12. |
| 174 | +8. In the **ContosoConf – F12** window, on the **Tools** menu, point to **Resize**, and then select **480×800**. |
175 | 175 | 9. Press F12. |
176 | 176 | 10. Verify that the navigation bar is displayed correctly in the reduced form factor (it wraps), and that the **Register** link does not appear in the header of the web page. |
177 | 177 |
|
178 | 178 |  |
179 | 179 |
|
180 | | -11. Close Microsoft Edge. |
| 180 | +11. Close Microsoft Edge. |
181 | 181 |
|
182 | | ->**Results:** After completing this exercise, you will have a website that adapts to different screen sizes. |
| 182 | +>**Results**: After completing this exercise, you will have a website that adapts to different screen sizes. |
183 | 183 |
|
184 | 184 | ©2018 Microsoft Corporation. All rights reserved. |
185 | 185 |
|
|
0 commit comments