{"id":1393,"date":"2016-10-25T16:20:29","date_gmt":"2016-10-25T23:20:29","guid":{"rendered":"http:\/\/miriamposner.com\/classes\/dh101f16\/?page_id=1393"},"modified":"2016-10-25T17:00:24","modified_gmt":"2016-10-26T00:00:24","slug":"build-a-webpage-from-scratch-with-html","status":"publish","type":"page","link":"https:\/\/miriamposner.com\/classes\/dh101f16\/tutorials-guides\/web-publishing\/html-css\/build-a-webpage-from-scratch-with-html\/","title":{"rendered":"Build a webpage from scratch with HTML"},"content":{"rendered":"<div class=\"wrapper section-inner\">\n<div class=\"content left\">\n<div class=\"posts\">\n<div class=\"post\">\n<div class=\"post-content\">\n<div class=\"LessonContent\">\n<div class=\"LessonSummary\">\n<p>HTML is the language that web browsers (like Firefox, Chrome, and Safari) understand. It\u2019s a <strong>markup language<\/strong>, meaning you annotate content with it so that the browser treats that content in different ways. (HTML\u00a0stands for <em>hypertext markup language<\/em>, if you&#8217;re curious.)<\/p>\n<p>It\u2019s not too hard to learn, and it\u2019s fun!<\/p>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">Get set up<\/h3>\n<div class=\"StepImage\"><a href=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.15.42-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1394 aligncenter\" src=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.15.42-PM-300x246.png\" alt=\"screen-shot-2016-10-25-at-4-15-42-pm\" width=\"500\" height=\"410\" srcset=\"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.15.42-PM-300x246.png 300w, https:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.15.42-PM.png 635w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a><\/div>\n<p>In the\u00a0<strong>Applications<\/strong> folder of your computer, double-click on\u00a0the\u00a0<strong>Sublime<\/strong> program to open it.<\/p>\n<p><strong>Sublime<\/strong> is 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 Sublime or one of the many alternatives, like <a href=\"https:\/\/atom.io\/\">Atom<\/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\" aria-describedby=\"caption-attachment-1399\" style=\"width: 688px\" 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\" 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\" srcset=\"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/10\/Screen-Shot-2016-10-25-at-4.41.29-PM-1.png 688w, https:\/\/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\" sizes=\"auto, (max-width: 688px) 85vw, 688px\" \/><\/a><figcaption id=\"caption-attachment-1399\" class=\"wp-caption-text\">The text won&#8217;t look all beautiful and pink like it does in this image until you save your Sublime text file as an HTML document.<\/figcaption><\/figure>\n<\/div>\n<div class=\"StepInstructions\">\n<p>A <strong>document declaration<\/strong> gives instructions to the web browser (like Safari or Firefox) for how to handle the document you\u2019ve created. Luckily, they\u2019re 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 <strong>return <\/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 close your html tag by typing<\/p>\n<pre>&lt;\/html&gt;<\/pre>\n<p>(Your browser doesn\u2019t care about spaces and returns that aren\u2019t inside HTML tags.)<\/p>\n<p>It\u2019s considered good practice to divide up your webpage into <strong>head<\/strong> and <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 <strong>return<\/strong> and 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 <strong>body<\/strong> section. Below your <strong>&lt;head&gt;<\/strong> tag, 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\u2019s 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 <strong>&lt;p&gt;<\/strong> stands for:\u00a0<strong>paragraph<\/strong><\/p>\n<p><strong>Save<\/strong> your document as <strong>index.html<\/strong>.<\/p>\n<p><strong>Leave your document open<\/strong> and 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\u2019ve 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 <strong>save <\/strong>the document. Now click <strong>Refresh<\/strong> on your web browser. The text on the webpage should show the new text you\u2019ve 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 style=\"width: 540px\" 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 Sublime, 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\u2019s 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\u2019s a webpage without a link? They work like this:<\/p>\n<pre>&lt;a href=\u201dwww.google.com\u201d&gt;text of your link&lt;\/a&gt;<\/pre>\n<p>In the example above, <strong>www.google.com<\/strong> is the URL to which you want to link and\u00a0<strong>text of your link<\/strong> is 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\u2019s an image out there on the Web that you\u2019d like to embed on your page, you can grab the link to the image by right-clicking on the image and clicking <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\u2019d like to use, you can save it <strong>at the same place where your html file is saved<\/strong> and 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 <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\u2019ll see that it looks funny: it starts with<\/p>\n<pre>file:\/\/\/<\/pre>\n<p>not<\/p>\n<pre>http:\/\/<\/pre>\n<p>That\u2019s because you\u2019re working on your file <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 <strong>hosted on a server<\/strong>, meaning moved to a special computer whose job is to broadcast files to the internet. You don\u2019t have a server yet, but you will on Friday. Francesca 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. <a href=\"http:\/\/miriamposner.com\/classes\/dh101f16\/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<\/div>\n<\/div>\n<\/div>\n<div class=\"clear\"><\/div>\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\u2019s a markup language, meaning you annotate content with it so that the browser treats that content &hellip; <a href=\"https:\/\/miriamposner.com\/classes\/dh101f16\/tutorials-guides\/web-publishing\/html-css\/build-a-webpage-from-scratch-with-html\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Build a webpage from scratch with HTML&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1391,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","footnotes":""},"class_list":["post-1393","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/pages\/1393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/comments?post=1393"}],"version-history":[{"count":0,"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/pages\/1393\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/pages\/1391"}],"wp:attachment":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f16\/wp-json\/wp\/v2\/media?parent=1393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}