{"id":810,"date":"2023-03-08T11:56:03","date_gmt":"2023-03-08T11:56:03","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=810"},"modified":"2023-03-08T13:18:56","modified_gmt":"2023-03-08T13:18:56","slug":"getting-started","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/getting-started\/","title":{"rendered":"Getting started"},"content":{"rendered":"\n<p>All HTML documents must start with a &lt;!DOCTYPE&gt; declaration.<\/p>\n\n\n\n<p>The declaration is not an HTML tag. It is an \u201cinformation\u201d to the browser about what document type to expect.<\/p>\n\n\n\n<p>In HTML 5, the declaration is simple:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;<\/code><\/pre>\n\n\n\n<p>Make a new text file and save it as index.html, add the code as we go along in this page. The filename index.html is used to represent the home page of a site for most webservers by default.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;html&gt; tag represents the root of an HTML document.<\/p>\n\n\n\n<p>The &lt;html&gt; tag is the container for all other HTML elements (except for the &lt;!DOCTYPE&gt; tag).<\/p>\n\n\n\n<p>Note: You should always include the lang attribute inside the &lt;html&gt; tag, to declare the language of the Web page. This is meant to assist search engines and browsers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;head&gt; element is a container for metadata (data about data) and is placed between the &lt;html&gt; tag and the &lt;body&gt; tag.<\/p>\n\n\n\n<p>Metadata is data about the HTML document. Metadata is not displayed.<\/p>\n\n\n\n<p>Metadata typically define the document title, character set, styles, scripts, and other meta information.<\/p>\n\n\n\n<p>The following elements can go inside the &lt;head&gt; element:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;title&gt; (required in every HTML document)<\/li><li>&lt;style&gt;<\/li><li>&lt;link&gt;<\/li><li>&lt;meta&gt;<\/li><li>&lt;script&gt;<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n  \n  &lt;\/head&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;link&gt; tag defines the relationship between the current document and an external resource.<\/p>\n\n\n\n<p>The &lt;link&gt; tag is most often used to link to external style sheets.<\/p>\n\n\n\n<p>The &lt;link&gt; element is an empty element, it contains attributes only.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/style.css\"&gt;\n  &lt;\/head&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Here we&#8217;ve used a link to add a stylesheet that will control how the page will look. We&#8217;ll cover this more in next week&#8217;s lessons on CSS. For now just create an empty text file and save it as style.css in the same folder as this index.html file.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;meta&gt; tag defines metadata about an HTML document. Metadata is data (information) about data.<\/p>\n\n\n\n<p>&lt;meta&gt; tags always go inside the &lt;head&gt; element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.<\/p>\n\n\n\n<p>Metadata will not be displayed on the page, but is machine parsable.<\/p>\n\n\n\n<p>Metadata is used by browsers (how to display content or reload page), search engines (keywords), and other web services.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/style.css\"&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta author=\"Your name here\"&gt;\n  &lt;\/head&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;script&gt; tag is used to embed a client-side script (JavaScript).<\/p>\n\n\n\n<p>The &lt;script&gt; element either contains scripting statements, or it points to an external script file through the src attribute.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/style.css\"&gt;\n    &lt;script type=\"text\/javascript\" src=\"\/script.js\"&gt;&lt;\/script&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta author=\"Your name here\"&gt;\n  &lt;\/head&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Create a new empty text file in the same folder and save it as script.js. We&#8217;ll cover this in the week on Javascript.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;title&gt; tag defines the title of the document. The title must be text-only, and it is shown in the browser\u2019s title bar or in the page\u2019s tab.<\/p>\n\n\n\n<p>The &lt;title&gt; tag is required in HTML documents!<\/p>\n\n\n\n<p>The contents of a page title is very important for search engine optimization (SEO)! The page title is used by search engine algorithms to decide the order when listing pages in search results.<\/p>\n\n\n\n<p>The &lt;title&gt; element:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>defines a title in the browser toolbar<\/li><li>provides a title for the page when it is added to favourites<\/li><li>displays a title for the page in search-engine results<\/li><\/ul>\n\n\n\n<p>Note: You can NOT have more than one &lt;title&gt; element in an HTML document.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/style.css\"&gt;\n    &lt;script type=\"text\/javascript\" src=\"\/script.js\"&gt;&lt;\/script&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta author=\"Your name here\"&gt;\n    &lt;title&gt;My first webpage&lt;\/title&gt;\n  &lt;\/head&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>The &lt;body&gt; tag defines the document\u2019s body.<\/p>\n\n\n\n<p>The &lt;body&gt; element contains all the contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.<\/p>\n\n\n\n<p>Note: There can only be one &lt;body&gt; element in an HTML document.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/style.css\"&gt;\n    &lt;script type=\"text\/javascript\" src=\"\/script.js\"&gt;&lt;\/script&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta author=\"Your name here\"&gt;\n    &lt;title&gt;My first webpage&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    This is my first web page!\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"324\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/08121017\/html1.png\" alt=\"Example output of the code\" class=\"wp-image-816\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/08121017\/html1.png 649w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/08121017\/html1-300x150.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><figcaption>Example output of the code<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/html-layout\/\" data-type=\"page\" data-id=\"819\">Next: HTML layout<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>All HTML documents must start with a &lt;!DOCTYPE&gt; declaration. The declaration is not an HTML tag. It is an \u201cinformation\u201d to the browser about what document type to expect. In HTML 5, the declaration is simple: Make a new text file and save it as index.html, add the code as we go along in this&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/getting-started\/\">Continue reading <span class=\"screen-reader-text\">Getting started<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":54,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-810","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/users\/5710"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/comments?post=810"}],"version-history":[{"count":7,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/810\/revisions"}],"predecessor-version":[{"id":826,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/810\/revisions\/826"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/54"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/media?parent=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}