{"id":803,"date":"2023-03-08T11:45:37","date_gmt":"2023-03-08T11:45:37","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=803"},"modified":"2023-03-08T11:56:14","modified_gmt":"2023-03-08T11:56:14","slug":"html-overview","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/html-overview\/","title":{"rendered":"HTML Overview"},"content":{"rendered":"\n<p>An HTML element is defined by a start tag, some content, and an end tag.<\/p>\n\n\n\n<p>The HTML element is everything from the start tag to the end tag.<\/p>\n\n\n\n<p>HTML elements can be nested (this means that elements can contain other elements), but nested elements must close before the higher level tags close.<\/p>\n\n\n\n<p>All HTML documents consist of nested HTML elements.<\/p>\n\n\n\n<p>HTML elements with no content are called empty elements.<\/p>\n\n\n\n<p>The br tag defines a line break and is an empty element without a closing tag.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Closing Tag Examples<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h3 class=\"wp-block-heading\">Valid<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;p&gt;Hello everyone&lt;\/p&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"index.html\"&gt;click here&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div&gt;\n  &lt;h1&gt;Heading&lt;\/h1&gt;\n  &lt;p class=\"largered\"&gt;Paragraph 1&lt;\/p&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h3 class=\"wp-block-heading\">Invalid<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;p&gt;Hello everyone<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"index.html\"&gt;click here&lt;a&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div&gt;\n  &lt;h1&gt;Heading&lt;\/h1&gt;\n  &lt;p class=\"largered\"&gt;Paragraph 1&lt;\/div&gt;\n&lt;\/p&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Types of tag<\/h2>\n\n\n\n<p>We will split that tags into the groups:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Special<\/li><li>Layout<\/li><li>Text<\/li><li>Multimedia<\/li><li>Forms<\/li><li>Advanced and rarely used<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Special<\/h3>\n\n\n\n<p>Tags that don\u2019t have a graphical aim or alter the layout. These are often mandatory for a valid HTML document.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;html&gt;<\/li><li>&lt;!DOCTYPE&gt;<\/li><li>&lt;head&gt;<\/li><li>&lt;link&gt;<\/li><li>&lt;meta&gt;<\/li><li>&lt;script&gt;<\/li><li>&lt;style&gt;<\/li><li>&lt;title&gt;<\/li><li>&lt;body&gt;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Layout<\/h3>\n\n\n\n<p>Layout elements are used to position the elements of the webpage on the screen.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;header&gt;<\/li><li>&lt;nav&gt;<\/li><li>&lt;main&gt;<\/li><li>&lt;div&gt;<\/li><li>&lt;section&gt;<\/li><li>&lt;footer&gt;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Text<\/h3>\n\n\n\n<p>Text elements control how text is either displayed or grouped.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;a&gt;<\/li><li>&lt;h1&gt;, &lt;h2&gt;, &lt;h3&gt;, &lt;h4&gt;, &lt;h5&gt;, &lt;h6&gt;<\/li><li>&lt;p&gt;<\/li><li>&lt;ul&gt;, &lt;ol&gt;, &lt;li&gt;<\/li><li>&lt;strong&gt;<\/li><li>&lt;em&gt;<\/li><li>&lt;i&gt;<\/li><li>&lt;span&gt;<\/li><li>&lt;table&gt;, &lt;thead&gt;, &lt;tbody&gt;, &lt;tfoot&gt;, &lt;tr&gt;, &lt;th&gt;, &lt;td&gt;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Multimedia<\/h3>\n\n\n\n<p>Multimedia tags are used for all the content that isn\u2019t simply text.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;source&gt;<\/li><li>&lt;audio&gt;<\/li><li>&lt;video&gt;<\/li><li>&lt;picture&gt;<\/li><li>&lt;img&gt;<\/li><li>&lt;embed&gt;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Forms<\/h3>\n\n\n\n<p>If you need a user to send data from the website you need to use form elements.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&lt;form&gt;<\/li><li>&lt;button&gt;<\/li><li>&lt;input&gt;<\/li><li>&lt;label&gt;<\/li><li>&lt;select&gt;, &lt;option&gt;<\/li><li>&lt;textarea&gt;<\/li><li>&lt;fieldset&gt;<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p>There are many more tags that can be used for special purposes. For more information on any tags, you can find details online at&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.w3schools.com\/html\/default.asp\" target=\"_blank\">https:\/\/www.w3schools.com\/html\/default.asp<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Attributes<\/h2>\n\n\n\n<p>HTML attributes provide additional information about HTML elements.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All HTML elements can have attributes<\/li><li>Attributes provide additional information about elements<\/li><li>Attributes are always specified in the start tag<\/li><li>Attributes usually come in name\/value pairs like: name=\u201dvalue\u201d<\/li><\/ul>\n\n\n\n<p>Common attributes are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>name<\/li><li>alt<\/li><li>width<\/li><li>height<\/li><li>title<\/li><li>src<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">ID<\/h3>\n\n\n\n<p>The id attribute specifies a unique id for an HTML element. The value of the id attribute must be unique within the HTML document.<\/p>\n\n\n\n<p>The id attribute is used to point to a specific style declaration in a style sheet which we will cover in more detail in the CSS part of the course. It is also used by JavaScript to access and manipulate the element with the specific id. You don\u2019t need to assign an id to each element.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"list_of_users\"&gt;Content&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Class<\/h3>\n\n\n\n<p>The HTML class attribute is used to specify a class for an HTML element.<\/p>\n\n\n\n<p>Multiple HTML elements can share the same class.<\/p>\n\n\n\n<p>The class attribute can contain multiple classes, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div class=\"large left-aligned error collapsed\"&gt;Content&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Block vs inline<\/h2>\n\n\n\n<p>Every HTML element has a default display value, depending on what type of element it is. There are two display values: block and inline.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Block<\/h3>\n\n\n\n<p>A block-level element always starts on a new line.<\/p>\n\n\n\n<p>A block-level element always takes up the full width available (stretches out to the left and right as far as it can).<\/p>\n\n\n\n<p>A block level element has a top and a bottom margin, whereas an inline element does not. Here are the block-level elements in HTML:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;address&gt;<\/li><li>&lt;article&gt;<\/li><li>&lt;aside&gt;<\/li><li>&lt;blockquote&gt;<\/li><li>&lt;canvas&gt;<\/li><li>&lt;dd&gt;<\/li><li>&lt;div&gt;<\/li><li>&lt;dl&gt;<\/li><li>&lt;dt&gt;<\/li><li>&lt;fieldset&gt;<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;figcaption&gt;<\/li><li>&lt;figure&gt;<\/li><li>&lt;footer&gt;<\/li><li>&lt;form&gt;<\/li><li>&lt;h1&gt;-&lt;h6&gt;<\/li><li>&lt;header&gt;<\/li><li>&lt;hr&gt;<\/li><li>&lt;li&gt;<\/li><li>&lt;main&gt;<\/li><li>&lt;nav&gt;<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;noscript&gt;<\/li><li>&lt;ol&gt;<\/li><li>&lt;p&gt;<\/li><li>&lt;pre&gt;<\/li><li>&lt;section&gt;<\/li><li>&lt;table&gt;<\/li><li>&lt;tfoot&gt;<\/li><li>&lt;ul&gt;<\/li><li>&lt;video&gt;<\/li><\/ul>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Inline<\/h3>\n\n\n\n<p>An inline element does not start on a new line.<\/p>\n\n\n\n<p>An inline element only takes up as much width as necessary. Here are the inline elements in HTML:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;a&gt;<\/li><li>&lt;abbr&gt;<\/li><li>&lt;acronym&gt;<\/li><li>&lt;b&gt;<\/li><li>&lt;bdo&gt;<\/li><li>&lt;dig&gt;<\/li><li>&lt;br&gt;<\/li><li>&lt;button&gt;<\/li><li>&lt;cite&gt;<\/li><li>&lt;code&gt;<\/li><li>&lt;dfn&gt;<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;em&gt;<\/li><li>&lt;i&gt;<\/li><li>&lt;img&gt;<\/li><li>&lt;input&gt;<\/li><li>&lt;kbd&gt;<\/li><li>&lt;label&gt;<\/li><li>&lt;map&gt;<\/li><li>&lt;object&gt;<\/li><li>&lt;output&gt;<\/li><li>&lt;q&gt;<\/li><li>&lt;samp&gt;<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ul class=\"wp-block-list\"><li>&lt;script&gt;<\/li><li>&lt;select&gt;<\/li><li>&lt;small&gt;<\/li><li>&lt;span&gt;<\/li><li>&lt;strong&gt;<\/li><li>&lt;sub&gt;<\/li><li>&lt;sup&gt;<\/li><li>&lt;textarea&gt;<\/li><li>&lt;time&gt;<\/li><li>&lt;tt&gt;<\/li><li>&lt;var&gt;<\/li><\/ul>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Don\u2019t Panic!<\/h2>\n\n\n\n<p>Most of these are rarely used. Over the rest of the course you will be shown the most useful and commonly used tags.<\/p>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/getting-started\/\" data-type=\"page\" data-id=\"810\">Next: Getting started<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An HTML element is defined by a start tag, some content, and an end tag. The HTML element is everything from the start tag to the end tag. HTML elements can be nested (this means that elements can contain other elements), but nested elements must close before the higher level tags close. All HTML documents&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-1\/html-overview\/\">Continue reading <span class=\"screen-reader-text\">HTML Overview<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":54,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-803","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/803","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=803"}],"version-history":[{"count":6,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/803\/revisions"}],"predecessor-version":[{"id":812,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/803\/revisions\/812"}],"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=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}