{"id":189,"date":"2017-09-27T03:53:08","date_gmt":"2017-09-27T03:53:08","guid":{"rendered":"http:\/\/miriamposner.com\/classes\/dh101f17\/?page_id=189"},"modified":"2017-11-01T13:07:39","modified_gmt":"2017-11-01T20:07:39","slug":"build-a-web-page-from-scratch-with-html","status":"publish","type":"page","link":"http:\/\/miriamposner.com\/classes\/dh101f17\/tutorials-guides\/web-publishing\/html-css\/build-a-web-page-from-scratch-with-html\/","title":{"rendered":"Build a web page from scratch with HTML"},"content":{"rendered":"<div class=\"LessonSummary\">\n<p>HTML is the language that web browsers (like Firefox, Chrome, and Safari) understand. It&#8217;s a\u00a0<strong>markup language<\/strong>, meaning you annotate content with it so that the browser treats that content in different ways. (HTML\u00a0stands for\u00a0<em>hypertext markup language<\/em>, if you&#8217;re curious.)<\/p>\n<p>It&#8217;s not too hard to learn, and it&#8217;s fun! The hardest thing about this tutorial will be arranging windows on your screen so that you can see everything at once. In one browser window or tab, leave this tutorial open so that you can refer to it as you proceed.<\/p>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Get set up<\/h3>\n<p><a href=\"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-content\/uploads\/sites\/7\/2017\/09\/Screen-Shot-2017-11-01-at-10.37.24-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1994\" src=\"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-content\/uploads\/sites\/7\/2017\/09\/Screen-Shot-2017-11-01-at-10.37.24-AM.png\" alt=\"\" width=\"541\" height=\"238\" srcset=\"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-content\/uploads\/sites\/7\/2017\/09\/Screen-Shot-2017-11-01-at-10.37.24-AM.png 541w, http:\/\/miriamposner.com\/classes\/dh101f17\/wp-content\/uploads\/sites\/7\/2017\/09\/Screen-Shot-2017-11-01-at-10.37.24-AM-300x132.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/a><\/p>\n<div class=\"StepImage\"><\/div>\n<p>Download <a href=\"https:\/\/atom.io\/\">Atom<\/a> and double-click it to open it. When you open Atom for the first time, three tabs will appear in the window. <em>Please close all the tabs except for the one called &#8220;untitled.&#8221;<\/em><\/p>\n<p><strong>Atom<\/strong>\u00a0is a (free) text editor, which is the name for the kind of program that you type code into. Just like Microsoft Word, it displays the text that you type. But unlike Microsoft Word, it doesn&#8217;t (invisibly) surround your text with formatting information. So never\u00a0use Microsoft Word for your code! Instead, use Atom or one of the many alternatives, like\u00a0<a href=\"https:\/\/www.sublimetext.com\/\">Sublime<\/a>.<\/p>\n<p>Believe it or not, a plain text editor (like Sublime) and a web browser (like Chrome, Safari, or Firefox) are all you need to build even the fanciest webpage!<\/p>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Enter the document declaration and a little bit of text<\/h3>\n<div class=\"StepImage\">\n<figure id=\"attachment_1399\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.41.29-PM-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1399\" src=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.41.29-PM-1.png\" sizes=\"auto, (max-width: 688px) 85vw, 688px\" srcset=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.41.29-PM-1.png 688w, http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.41.29-PM-1-300x168.png 300w\" alt=\"The text won't look all beautiful and pink like it does in this image until you save your Sublime text file as an HTML document.\" width=\"688\" height=\"386\" \/><\/a><figcaption class=\"wp-caption-text\">The text won&#8217;t look all beautiful and pink like it does in this image until you save your Atom text file as an HTML document.<\/figcaption><\/figure>\n<\/div>\n<div class=\"StepInstructions\">\n<p>A\u00a0<strong>document declaration<\/strong>\u00a0gives instructions to the web browser (like Safari or Firefox) for how to handle the document you&#8217;ve created. Luckily, they&#8217;re easy to make. Just type<\/p>\n<pre>&lt;!DOCTYPE html&gt;<\/pre>\n<p>at the very top of the document.<\/p>\n<p>Then press\u00a0<strong>return\u00a0<\/strong>and type in<\/p>\n<pre>&lt;html&gt;<\/pre>\n<p>to tell the browser to expect HTML in the document that follows. Then skip a few lines and <strong>close<\/strong> your html tag by typing<\/p>\n<pre>&lt;\/html&gt;<\/pre>\n<p>(Your browser won&#8217;t care about spaces and returns inside the header.)<\/p>\n<p>It&#8217;s considered good practice to divide up your webpage into\u00a0<strong>head<\/strong>\u00a0and\u00a0<strong>body\u00a0<\/strong>sections. Special instructions for the browser (if you have any) go in the head section. Content goes in the body section.<\/p>\n<p>To make these sections, press\u00a0<strong>return<\/strong>\u00a0and enter<\/p>\n<pre>&lt;head&gt;<\/pre>\n<p>somewhere inside your opening and closing &lt;html&gt; tags.<\/p>\n<p>After you create your head tag, leave a line or two blank and close your head tag by typing<\/p>\n<pre>&lt;\/head&gt;<\/pre>\n<p>Now make the\u00a0<strong>body<\/strong>\u00a0section. Below your\u00a0<strong>&lt;head&gt;<\/strong>\u00a0tag, type<\/p>\n<pre>&lt;body&gt;<\/pre>\n<p>Then skip a few lines and type<\/p>\n<pre>&lt;\/body&gt;<\/pre>\n<p>Let&#8217;s put some text in, too, so we have something to look at. Type<\/p>\n<pre>&lt;p&gt;Welcome to my webpage&lt;\/p&gt;<\/pre>\n<p>after your opening body tag and before the closing body tag. Perhaps you remember what\u00a0<strong>&lt;p&gt;<\/strong>\u00a0stands for:\u00a0<strong>paragraph<\/strong><\/p>\n<p><strong>Save<\/strong>\u00a0your document as\u00a0<strong>index.html<\/strong>, somewhere you can locate it again easily.<\/p>\n<p><strong>Leave your Atom document open<\/strong>\u00a0and navigate to where you saved the file. Double-click the icon for the file you saved. By default, that\u00a0file should open up in a browser. Now you&#8217;ve opened the file in two different ways: as a webpage and as a text file. Arrange your windows so you can see the document open as a text document and as a webpage, simultaneously.<\/p>\n<p>On your text document, alter the text between the paragraph tags so that it says something different and\u00a0<strong>save\u00a0<\/strong>the document. Now click\u00a0<strong>Refresh<\/strong>\u00a0on your web browser. The text on the webpage should show the new text you&#8217;ve saved.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Add a header<\/h3>\n<div class=\"StepImage\">\n<figure class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445881809528.png\" alt=\"media_1445881809528.png\" width=\"540\" height=\"239\" \/><figcaption class=\"wp-caption-text\">I know the text editor looks different in this image than it does in previous images. I switched text editors, but you&#8217;ll still use Atom, so your text editor will look as it does in previous images.<\/figcaption><\/figure>\n<\/div>\n<div class=\"StepInstructions\">\n<p>By default, headers instruct browsers to treat text inside differently, to signal that it&#8217;s important. Add a header to your page by putting some text in<\/p>\n<pre>&lt;h1&gt;<\/pre>\n<p>tags, somewhere above your paragraph tags. Save the document and refresh your browser. You should now have a header on your page! Looking good.<\/p>\n<p>You can also use<\/p>\n<pre>&lt;h2&gt;<\/pre>\n<p>tags, which are a bit smaller, and<\/p>\n<pre>&lt;h3&gt;<\/pre>\n<p>tags, which are smaller still, all the way to<\/p>\n<pre>&lt;h5&gt;<\/pre>\n<p>tags. Experiment with different-sized headers, saving and refreshing as you go.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">How links work<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445643187364.png\" alt=\"media_1445643187364.png\" width=\"540\" height=\"390\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>What&#8217;s a webpage without a link? They work like this:<\/p>\n<pre>&lt;a href=\"www.google.com\"&gt;text of your link&lt;\/a&gt;<\/pre>\n<p>In the example above,\u00a0<strong>www.google.com<\/strong>\u00a0is the URL to which you want to link and\u00a0<strong>text of your link<\/strong>\u00a0is the text that actually appears as a hyperlink.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Create a link on your page<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445881956409.png\" alt=\"media_1445881956409.png\" width=\"540\" height=\"288\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Try it yourself by creating a new paragraph (using the opening and closing &lt;p&gt; tags) and creating a link in your new paragraph. Save your document, refresh your browser and test your link!<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">How images work<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445643753324.png\" alt=\"media_1445643753324.png\" width=\"540\" height=\"324\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>You can link to an image in one of two ways. If there&#8217;s an image out there on the Web that you&#8217;d like to embed on your page, you can grab the link to the image by right-clicking on the image and clicking\u00a0<strong>Copy Image URL<\/strong>. Then you can embed the image by pasting the link, as above.<\/p>\n<p>If you have an image on your computer that you&#8217;d like to use, you can save it\u00a0<strong>at the same place where your html file is saved<\/strong>\u00a0and link directly to it by entering the file name, as above.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Add an image<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445882026340.png\" alt=\"media_1445882026340.png\" width=\"540\" height=\"275\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Add an image to your webpage using one of the two methods from the previous step.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Add some emphasis<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445882087519.png\" alt=\"media_1445882087519.png\" width=\"540\" height=\"283\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Sometimes you want to highlight particular text on your page, to indicate that the browser should treat it differently. Common tags for this are<\/p>\n<pre>&lt;em&gt;<\/pre>\n<p>(which stands for\u00a0<strong>emphasis<\/strong>; by default, your browser will italicize the text inside this tag) and<\/p>\n<pre>&lt;strong&gt;<\/pre>\n<p>(by default, your browser will bold the text inside this tag).<\/p>\n<p>Create more text and experiment with emphasis and headers. Just remember to always close those tags!<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">But wait! No one can see your page!<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445644435551.png\" alt=\"media_1445644435551.png\" width=\"540\" height=\"565\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>If you look closely at the URL on your webpage, you&#8217;ll see that it looks funny: it starts with<\/p>\n<pre>file:\/\/\/<\/pre>\n<p>not<\/p>\n<pre>http:\/\/<\/pre>\n<p>That&#8217;s because you&#8217;re working on your file\u00a0<strong>locally<\/strong>, meaning just on your own computer. No one else can see your webpage at the moment.<\/p>\n<p>In order for other people to see your file, it has to be\u00a0<strong>hosted on a server<\/strong>, meaning moved to a special computer whose job is to broadcast files to the internet. You don&#8217;t have a server yet, but you will on Friday. Francesca or Dustin will show you how to purchase server space and move your file to a server.<\/p>\n<p>For now, though, you did it! You built a webpage! It&#8217;s still not very pretty, though.\u00a0<a href=\"http:\/\/miriamposner.com\/classes\/dh101f17\/tutorials-guides\/web-publishing\/html-css\/paint-that-page-with-css\/\">Let&#8217;s decorate it in the next tutorial!<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTML is the language that web browsers (like Firefox, Chrome, and Safari) understand. It&#8217;s a\u00a0markup language, meaning you annotate content<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":43,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","footnotes":""},"class_list":["post-189","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/189\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/43"}],"wp:attachment":[{"href":"http:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/media?parent=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}