html5 and css3 Complete - Unit B
html5 and css3 Complete - Unit B
45 Marsh Grass Ln. - Marble, MN 55766 - (218) $$8-3252
4 2 Giz nn FIGURE ‘Lang attribute inserted in openingtag, then press [Spacebar] three times or as needed to create an indent Becauise you are adding a parent element, you increase the indentation of tags for child elements to keep your code readable. Compare your code to FIGURE, which shows the code containing the new div element. 6. Save your document, return to your browser, then refresh or reload aboutus.html in your browser ‘As shown in FIGURE B-6, the appearance ofthe page in the browser does not change. Because the div ‘element is used for structuring code, adding the div element to the document does not change the way the document is rendered. The document looks the same after the div element is added as it did before. Many users want a proces of finding and consuming web content with the goal of removing hal the words. This helps focus your that is dynamic and fast-paced. When you write content forthe \witng and reduces the content of your web page tothe essential, web, you should keep ths in mind, Web content should generallybe which makes it easier fr web users to scan and rad. brief and scannable. A user should be able to get the gist of what ‘ter you publish content onlin, it's crucial to keep it up to your page contains with a quick glance. his allows ser to quickly _date—outof date information makes your website's content sem decide to tay on the page ifthe page contains the information Unreliable. You can minimize the amount of regular updating you they/'e looking for, orto navigate elsewhere and keep looking, You need to do by reducing or eliminating relative references to dates, ‘an make content scannable by incuding a shor, descriptive head- (such as “5 years ago” or “in 18 months") or labeling specific ing at the top, and by breaking the content itsef into sections with _ dates as being inthe future (such as “The building will be headings. After writing the actual content, itcan be useful toreviseit completed in 2013.") HED St cturing Content in a Web Document(Code containing new civ element 1 2 3
_iakeiand Reeds is an ideal place to unplug from your daily routine. We're Inexe to help you get the most out of your time with us, from cances and life lvests for a day out on the lake, to DVDs and popcorn for a quiet evening in. We Look forward to welcoming you!
45 Marsh Grass Ln. - Marble, MN 55764 - (218) 26 FIGURE 8-6: About Us page in a browser > © O filey//C:pUsers/sasha_000/Documents/394049_HTML_UB_Data_Files/Lessons/aboutushiml Lakeland Reeds i df'Geal place to unplog fee your dad routine. We're ere to help you get the most et of your tne with ws, fom canoes and fe ‘ssi for» day out onthe lake to DVDs ad popcorn for quet even m_ We look forward to elcoming Yow! 45 Marsh Grass La. - Marble, MBN 55764 - 218) 555-5253 Structuring Content in a Web DocumentHTMLS & CSS: 2 one * Use the HTMLS header, article, and Footer elements + Make semantic elements work for EB users. Itsoften possible to mark up web page contents semantically inmore than one way The choice of which elements to use can vary depend- ing onthe developer andthe st ‘A warning about blocked content might open, depend: ing on your browser seitngs. 0, allow blocked content Add HTML5 Semantic Elements All HTML elements have semantic value—that is, they indicate the meaning of their content. For instance, the hi element marks text as a top-level heading, and the p element marks a paragraph of text. The div clement has limited semantic meaning—it groups elements but adds no information about what type of information it contains, However, the most recent version of HTML, known as HTMILS, includes a number of grouping elements, known as semantic elements that indicate the role of their content. Search engines can use this semantic information to provide more accurate search results. This means that using semantic elements can make it easier for people using a search engine to find information about your business or organization. TABLE 8-2 lists several semantic elements. Because older versions of Internet Explorer can’t interpret semantic elements, you also include a script element in the head section, which instructs older browsers how to interpret the semantic elements. The script element references code in an external file that browsers can use to help them interpret the elements. (EHP You add the header and footer elements to indicate the content at the start and end of the page, and you add a script element referencing file that makes it possible fr users of older versions of Internet Explorer to view the document. FIGURE B-7 shows a wireframe of the About Us page with each section marked. 1. Return to aboutus.html in your editor 2. Click after the opening
tag, press [Enter], press [Spacebar] six times or as needed to create the indent, then typetag, then press [Spacebar] three times or as needed to create the indent 8. In the head section, click after the tag, press [Enter], press [Spacebar] six times or as needed to create the indent, then type A script element references an external script file whose name is specified as the sre attribute value. FIGURE B-8 shows the completed code. 9. Save your document, return to your browser, then refresh or reload aboutus.html Like the div element, semantic elements do not change the page's display in a browser. 10. If you have access to Internet Explorer 8 or an earlier version of Internet Explorer, use it to open aboutus.html Because of the script element you added to the document's head section, the document is displayed correctly in older versions of Internet Explorer Structuring Contentin a Web DocumentFIGURE 8-7; Wireframe for Lakeland eds Aout Us page Pageheader —-—>| Lakeland Reeds Bed & Breakfast description of amenities “content | Page footer —1—>] contact information SRetemnene FIGURE B-8: Code with semantic elements and script element Date: today’s date —————— BIMES and CSS3 Tilustreted Cait 3, Attribute value se enclosed in neta charset="utf-8"> Sieglot sfotodesnixs canton 6204.30" nript>-t $$ pleas |
lakelend Reeds is an ideal place to unplug Your/daity routine. We're here to help you get the most out of your from canoes and life q vests for a day out on the lake, to DVD ‘a quiet evening in. We look forward to welcoming you!
45 Marsh Grass In. 6#82%6; Marble, MN 55764 648226; (218) 5$5-5253
FIGURE 8.10: About Us page incorporating special characters (D Lakeland Reeds Bed &: Lakeland Reed About Us = nt Lakeland Reeds is an ideal p) the most out of your time and popeom for a quiet 45 Marsh Grass Ln. ¢ ‘TABLE B-3: Important character references & ampersand a3 samp; : apostrophe a3 ap08; (doesnot wok in olde versions of Inemet Explore) > gyeaterthan sign 6462; eat i < lessthan sign 460; ‘at f G quotation mark «3 ‘quot; 3 Structuring Contentina Web Document QEB Specify the Viewport ‘onsult the ‘ocumentation for fur web sever if ecessay, ven though the teta element “pports many rontent value ‘tions for ‘iewport, yOu sual ony nee to sethe vale that sts hewidth to levice-width as ‘didn tisstep. When the browser on a mobile device opens a web page, it needs to figure out how the document should be displayed on its small screen. Some web pages can scale to fit any browser, no matter the screen size. For other web pages, though, displaying the whole page at once would make its content too small to read. For this reason, most mobile browsers by default display only a portion of the page but at a legible size, These browsers display the page as if looking through an imaginary window, which is known as the viewport. To instruct browsers to display a page at the width of the browser window without zooming in, you change the browsers viewport settings using a viewport meta element, which is a meta ele- iment with the name attribute set to a value of viewport. As part of the viewport meta element, you also include a second attribute, content, whose value specifies one or more pairs of properties and values TABLE B-4 lists viewport. properties. To scale the page to fit the browser window, you use a content. value of width=device-width (QWaB> You adda viewport meta element to the About Us page to ensure that itis displayed at the width of the browser window on mobile devices. 1. Using your web server, open aboutus.html on a smartphone or other handheld mobile device ‘As shown in FIGURE B-11, most mobile devices zoom the web page, displaying it as if viewing only a portion cof a much larger screen and cutting off some of the content. To see all of the content at once would require ‘zooming out, at which point most content would be illegible. Return to aboutus.html in your editor 3. Inthe head section, click after thelakeland Reeds is an ideal place to unplug from your daily routine. We'ze here to help you get the most out of your time with ue, from cances and life vests for a day out on the lake, to DVDs and popcorn for a quiet evening in. look forward to welcoming you!