{"id":69,"date":"2020-12-17T14:04:00","date_gmt":"2020-12-17T19:04:00","guid":{"rendered":"https:\/\/pressbooks.library.ryerson.ca\/nps207\/?post_type=chapter&#038;p=69"},"modified":"2020-12-17T14:31:23","modified_gmt":"2020-12-17T19:31:23","slug":"chapter-4-%e2%80%a2-web","status":"publish","type":"chapter","link":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/chapter\/chapter-4-%e2%80%a2-web\/","title":{"raw":"Chapter 4 \u2022\u00a0Web","rendered":"Chapter 4 \u2022\u00a0Web"},"content":{"raw":"<h3>Building the Fixed-Width Web Page<\/h3>\r\n<ol>\r\n \t<li style=\"font-weight: 400\">Open a new Dreamweaver document, display Code View vertically on left and Live View on right, delete pre-written code.<\/li>\r\n \t<li style=\"font-weight: 400\">Add opening and closing tags for the document &lt;html&gt;, invisible head &lt;head&gt;, and visible area &lt;body&gt;.<\/li>\r\n \t<li style=\"font-weight: 400\">Copy-and-paste the text for the Introduction into the code, add &lt;p&gt; tags.<\/li>\r\n \t<li style=\"font-weight: 400\">Enter the title of your page and tag with &lt;h1&gt;.<\/li>\r\n \t<li style=\"font-weight: 400\">Insert Photo 1 with &lt;img&gt;, i.e. &lt;img src=\"image.jpg\" \/&gt;; this is a self-closing tag. Specify a class name for the image, e.g., &lt;img class=\"full-width\" src=\"image.jpg\" \/&gt;.<\/li>\r\n \t<li style=\"font-weight: 400\">Add a paragraph underneath with the caption for Photo 1, set up a class \"caption,\" i.e., &lt;p class=\"caption\"&gt;.<\/li>\r\n \t<li style=\"font-weight: 400\">Surround the text and image tags with a &lt;div&gt; or grouping tag ID'd as \"page\".<\/li>\r\n<\/ol>\r\n[caption id=\"attachment_77\" align=\"aligncenter\" width=\"1536\"]<a href=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1.jpg\"><img style=\"border: 6px solid lightgray\" src=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1.jpg\" alt=\"HTML page\" width=\"1536\" height=\"768\" class=\"wp-image-77 size-full\" \/><\/a> Figure 4-1. Fixed-width HTML page.[\/caption]\r\n<h3>CSS<\/h3>\r\n<ol>\r\n \t<li style=\"font-weight: 400\">In the head, write an opening and closing &lt;style&gt; tag.<\/li>\r\n \t<li style=\"font-weight: 400\">Add a style statement for the body, set background to \"whitesmoke\" (light gray).<\/li>\r\n \t<li style=\"font-weight: 400\">Style \"#page\" with width 1024px, height 1324px, background white, and center with \"margin: 0 auto;\"<\/li>\r\n \t<li style=\"font-weight: 400\">Style \"p\" and set font-face, font-size, line-height, width, and center if desired.<\/li>\r\n \t<li style=\"font-weight: 400\">Style \"h1\" and set as above, center with \"text-align: center;\"<\/li>\r\n \t<li style=\"font-weight: 400\">Style \".full-width,\" set width to 1024px or less, height to auto, center if desired; optionally add \"border: 1px solid gray;\" and \"box-shadow: 2px 3px 6px gray;\"<\/li>\r\n \t<li style=\"font-weight: 400\">If you want text to wrap around a smaller image, set the style to \"float: left;\" and add \"margin: 0px 24px 12px 0;\" to push away the text (numbers go clockwise from top).<\/li>\r\n \t<li style=\"font-weight: 400\">Style \".caption\" to be slightly smaller in size, italic, e.g., \"font-size: 12pt; font-style: italic;\"<\/li>\r\n<\/ol>\r\n<h3>Linking Photo 1 to Its High-Res Version<\/h3>\r\n<ol>\r\n \t<li style=\"font-weight: 400\">To link your 1024px-wide image to its high-res version, add a link tag, e.g.:\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;a href=\"image.jpg\"&gt;&lt;img class=\"full-width\" src=\"image.jpg\" \/&gt;&lt;\/a&gt;<\/span><\/li>\r\n<\/ol>\r\nThis way, when readers click on the image, they will see the full-res version, which is helpful in seeing all the detail and in aiding the visually impaired.\r\n\r\n&nbsp;\r\n\r\n[caption id=\"attachment_79\" align=\"aligncenter\" width=\"1536\"]<a href=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage.jpg\"><img src=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage.jpg\" alt=\"\" width=\"1536\" height=\"774\" class=\"size-full wp-image-79\" \/><\/a> <strong>Figure 4-2.<\/strong> Completed fixed-width page with high-res photo linked to low-res photo in page. Note use of the &lt;figure&gt; tag to group the photo (&lt;img&gt;) with the caption (&lt;figcaption&gt;).[\/caption]\r\n<h3>Setting the Page to Variable Width<\/h3>\r\n<ol>\r\n \t<li style=\"font-weight: 400\">All the tags that you styled as fixed-width, like \"width: 1024px;\" either (1) set the width in %, or add another tag, \"max-width: 100%;\"<\/li>\r\n<\/ol>\r\n<h3>Setting the Page to be Responsive (Look Good on a Smartphone)<\/h3>\r\n<ol>\r\n \t<li style=\"font-weight: 400\">Add an \"@media {}\" rule in the &lt;style&gt; statement that specifies the maximum width of the smartphone, usually 750px for iPhones, e.g. \"@media only screen and (max-width: 750px) {}.<\/li>\r\n \t<li style=\"font-weight: 400\">Inside the braces for the @media rule, enter the styles that apply to the iPhone, i.e.:\r\n<ol>\r\n \t<li style=\"font-weight: 400\">tags should be \"max-width: 100%;\" or a smaller percentage<\/li>\r\n \t<li style=\"font-weight: 400\">any images with text-wrap (\"float\") should be set to \"display: block;\" so they appear separately and take up the full width of the screen.<\/li>\r\n<\/ol>\r\n<\/li>\r\n<\/ol>","rendered":"<h3>Building the Fixed-Width Web Page<\/h3>\n<ol>\n<li style=\"font-weight: 400\">Open a new Dreamweaver document, display Code View vertically on left and Live View on right, delete pre-written code.<\/li>\n<li style=\"font-weight: 400\">Add opening and closing tags for the document &lt;html&gt;, invisible head &lt;head&gt;, and visible area &lt;body&gt;.<\/li>\n<li style=\"font-weight: 400\">Copy-and-paste the text for the Introduction into the code, add &lt;p&gt; tags.<\/li>\n<li style=\"font-weight: 400\">Enter the title of your page and tag with &lt;h1&gt;.<\/li>\n<li style=\"font-weight: 400\">Insert Photo 1 with &lt;img&gt;, i.e. &lt;img src=&#8221;image.jpg&#8221; \/&gt;; this is a self-closing tag. Specify a class name for the image, e.g., &lt;img class=&#8221;full-width&#8221; src=&#8221;image.jpg&#8221; \/&gt;.<\/li>\n<li style=\"font-weight: 400\">Add a paragraph underneath with the caption for Photo 1, set up a class &#8220;caption,&#8221; i.e., &lt;p class=&#8221;caption&#8221;&gt;.<\/li>\n<li style=\"font-weight: 400\">Surround the text and image tags with a &lt;div&gt; or grouping tag ID&#8217;d as &#8220;page&#8221;.<\/li>\n<\/ol>\n<figure id=\"attachment_77\" aria-describedby=\"caption-attachment-77\" style=\"width: 1536px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 6px solid lightgray\" src=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1.jpg\" alt=\"HTML page\" width=\"1536\" height=\"768\" class=\"wp-image-77 size-full\" srcset=\"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1.jpg 1536w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-300x150.jpg 300w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-1024x512.jpg 1024w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-768x384.jpg 768w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-65x33.jpg 65w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-225x113.jpg 225w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/fig4-1-1-350x175.jpg 350w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/a><figcaption id=\"caption-attachment-77\" class=\"wp-caption-text\">Figure 4-1. Fixed-width HTML page.<\/figcaption><\/figure>\n<h3>CSS<\/h3>\n<ol>\n<li style=\"font-weight: 400\">In the head, write an opening and closing &lt;style&gt; tag.<\/li>\n<li style=\"font-weight: 400\">Add a style statement for the body, set background to &#8220;whitesmoke&#8221; (light gray).<\/li>\n<li style=\"font-weight: 400\">Style &#8220;#page&#8221; with width 1024px, height 1324px, background white, and center with &#8220;margin: 0 auto;&#8221;<\/li>\n<li style=\"font-weight: 400\">Style &#8220;p&#8221; and set font-face, font-size, line-height, width, and center if desired.<\/li>\n<li style=\"font-weight: 400\">Style &#8220;h1&#8221; and set as above, center with &#8220;text-align: center;&#8221;<\/li>\n<li style=\"font-weight: 400\">Style &#8220;.full-width,&#8221; set width to 1024px or less, height to auto, center if desired; optionally add &#8220;border: 1px solid gray;&#8221; and &#8220;box-shadow: 2px 3px 6px gray;&#8221;<\/li>\n<li style=\"font-weight: 400\">If you want text to wrap around a smaller image, set the style to &#8220;float: left;&#8221; and add &#8220;margin: 0px 24px 12px 0;&#8221; to push away the text (numbers go clockwise from top).<\/li>\n<li style=\"font-weight: 400\">Style &#8220;.caption&#8221; to be slightly smaller in size, italic, e.g., &#8220;font-size: 12pt; font-style: italic;&#8221;<\/li>\n<\/ol>\n<h3>Linking Photo 1 to Its High-Res Version<\/h3>\n<ol>\n<li style=\"font-weight: 400\">To link your 1024px-wide image to its high-res version, add a link tag, e.g.:<br \/>\n<span style=\"text-align: initial;font-size: 1em\">&lt;a href=&#8221;image.jpg&#8221;&gt;&lt;img class=&#8221;full-width&#8221; src=&#8221;image.jpg&#8221; \/&gt;&lt;\/a&gt;<\/span><\/li>\n<\/ol>\n<p>This way, when readers click on the image, they will see the full-res version, which is helpful in seeing all the detail and in aiding the visually impaired.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_79\" aria-describedby=\"caption-attachment-79\" style=\"width: 1536px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/pressbooks.library.ryerson.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage.jpg\" alt=\"\" width=\"1536\" height=\"774\" class=\"size-full wp-image-79\" srcset=\"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage.jpg 1536w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-300x151.jpg 300w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-1024x516.jpg 1024w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-768x387.jpg 768w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-65x33.jpg 65w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-225x113.jpg 225w, https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-content\/uploads\/sites\/171\/2020\/12\/Fig4-2_DW-W_FixedWidthPage-350x176.jpg 350w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/a><figcaption id=\"caption-attachment-79\" class=\"wp-caption-text\"><strong>Figure 4-2.<\/strong> Completed fixed-width page with high-res photo linked to low-res photo in page. Note use of the &lt;figure&gt; tag to group the photo (&lt;img&gt;) with the caption (&lt;figcaption&gt;).<\/figcaption><\/figure>\n<h3>Setting the Page to Variable Width<\/h3>\n<ol>\n<li style=\"font-weight: 400\">All the tags that you styled as fixed-width, like &#8220;width: 1024px;&#8221; either (1) set the width in %, or add another tag, &#8220;max-width: 100%;&#8221;<\/li>\n<\/ol>\n<h3>Setting the Page to be Responsive (Look Good on a Smartphone)<\/h3>\n<ol>\n<li style=\"font-weight: 400\">Add an &#8220;@media {}&#8221; rule in the &lt;style&gt; statement that specifies the maximum width of the smartphone, usually 750px for iPhones, e.g. &#8220;@media only screen and (max-width: 750px) {}.<\/li>\n<li style=\"font-weight: 400\">Inside the braces for the @media rule, enter the styles that apply to the iPhone, i.e.:\n<ol>\n<li style=\"font-weight: 400\">tags should be &#8220;max-width: 100%;&#8221; or a smaller percentage<\/li>\n<li style=\"font-weight: 400\">any images with text-wrap (&#8220;float&#8221;) should be set to &#8220;display: block;&#8221; so they appear separately and take up the full width of the screen.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n","protected":false},"author":6,"menu_order":5,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-69","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapters\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/wp\/v2\/users\/6"}],"version-history":[{"count":6,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapters\/69\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapters\/69\/revisions\/81"}],"part":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapters\/69\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/pressbooks\/v2\/chapter-type?post=69"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/wp\/v2\/contributor?post=69"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/nps207\/wp-json\/wp\/v2\/license?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}