{"id":3661,"date":"2023-07-16T18:33:32","date_gmt":"2023-07-16T18:33:32","guid":{"rendered":"https:\/\/nmi.cool\/advweb\/?page_id=3661"},"modified":"2025-06-19T19:31:53","modified_gmt":"2025-06-19T19:31:53","slug":"html-basics-2","status":"publish","type":"page","link":"https:\/\/nmi.cool\/advweb\/unit-one-html-css\/week-zero\/html-basics-2\/","title":{"rendered":"Course Notes: HTML Basics"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Intro to HTML<\/h2>\n\n\n\n<p><strong>HTML (Hypertext Markup Language)<\/strong>: is a markup language used to tell your browser how to structure web pages<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Anatomy of an HTML element\n<ul class=\"wp-block-list\">\n<li>Opening\u00a0<code>&lt;<\/code>tags<code>&gt;<\/code>\u00a0name of the element enclosed in angle brackets<\/li>\n\n\n\n<li>Closing\u00a0<code>&lt;\/<\/code>tags<code>&gt;<\/code>: same as an opening but with a forward slash before the name of the element, signaling the end of the element<\/li>\n\n\n\n<li>The content: content of the element (ex: text, image, link)<\/li>\n\n\n\n<li>The element: created by the opening and closing tags<\/li>\n\n\n\n<li>Nesting elements: when you have the opening and closing tags of one element within the opening and closing tags of another element<\/li>\n\n\n\n<li>Block element: appears as a block, can be positioned anywhere on the page<\/li>\n\n\n\n<li>Inline element: normally appears inside of a text block element<\/li>\n\n\n\n<li>Tags reviewed:\n<ol class=\"wp-block-list\">\n<li><code>&lt;p&gt;<\/code>\u00a0paragraph element, text<\/li>\n\n\n\n<li><code>&lt;img&gt;<\/code>\u00a0embedded image file<\/li>\n\n\n\n<li><code>&lt;a&gt;<\/code>\u00a0\u201canchor\u201d hyperlink<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Attributes<\/strong>: contain information about the element that doesn\u2019t appear as content to the user\n<ul class=\"wp-block-list\">\n<li><code>class=<\/code>\u00a0gives the element style specifications<\/li>\n\n\n\n<li><code>href=<\/code>\u00a0gives the hyperlink a destination for the bowser to navigate to when clicked<\/li>\n\n\n\n<li><code>title=<\/code>\u00a0extra information about the link, appears as a tooltip when hovered over<\/li>\n\n\n\n<li><code>target=<\/code>\u00a0specifies how the link should be displayed (ex:\u00a0<code>target=\u201dblank\u201d<\/code>\u00a0displays the link in a new tab)<\/li>\n\n\n\n<li>Boolean attribute: attribute such as\u00a0<code>disabled<\/code>\u00a0that doesn\u2019t need a value<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Anatomy of a HTML document\n<ul class=\"wp-block-list\">\n<li><code>&lt;!DOCTYPE html&gt;<\/code>\u00a0the doctype specifies that this is page is coded using HTML<\/li>\n\n\n\n<li>Tags reviewed:\n<ul class=\"wp-block-list\">\n<li><code>&lt;html&gt;<\/code>\u00a0root element, contains all of the content of the entire document<\/li>\n\n\n\n<li><code>&lt;head&gt;<\/code>\u00a0container for the information you don\u2019t want to be visible to the user, includes a page\u2019s description<\/li>\n\n\n\n<li><code>&lt;title&gt;<\/code>\u00a0title of your page, appears in the browser tab<\/li>\n\n\n\n<li><code>&lt;body&gt;<\/code>\u00a0container for the all of the page\u2019s content, visible to the user<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Whitespace in HTML is ignored, any whitespace you use will be shrunk down to a single space, this allows you to format your code, increasing its readability, while not messing up the rendering of the code<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Special Characters in HTML\n<ul class=\"wp-block-list\">\n<li>Special characters such as &#8221; &#8216; &amp; &lt; &gt; mean different things in the HTML markup language so it&#8217;s best practice to not use them in your text content.<\/li>\n\n\n\n<li>When you want to make a special character appear, you can enter it a few different ways: HTML character name, unicode, hex, CSS, or Javascript.<\/li>\n\n\n\n<li>There&#8217;s no need to memorize them, here&#8217;s a page I found with a <a href=\"https:\/\/www.freeformatter.com\/html-entities.html\" target=\"_blank\" rel=\"noreferrer noopener\">List of HTML Character Entities<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>HTML comments<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The comment tags&nbsp;<code>&lt;!--<\/code>&nbsp;and&nbsp;<code>--&gt;<\/code>&nbsp;create text that is invisible to the user, does not affect the rendering of the code, and is only visible when looking at the code.<\/li>\n\n\n\n<li><code>&lt;!--Comments--&gt;<\/code>&nbsp;allow you to write notes in the code to yourself, or to other developers, and&nbsp;can help keep your code easy to navigate.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Metadata<\/h2>\n\n\n\n<p>The&nbsp;<strong>metadata<\/strong>&nbsp;of a document is located in the&nbsp;<code>&lt;head&gt;<\/code>&nbsp;element, describing the data that\u2019s in the rest of the document, a summary of the website that helps search engines find it<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>&lt;title&gt;<\/code>&nbsp;title that appears in the browser tab, metadata that represents the title of the overall document<\/li>\n\n\n\n<li><code>&lt;meta&gt;<\/code>&nbsp;element\n<ul class=\"wp-block-list\">\n<li>Character encoding\n<ul class=\"wp-block-list\">\n<li><code>&lt;meta charset=\u201dutf-8\u201d&gt;<\/code>&nbsp;sets the character set your document you should use to UTF-8, includes most characters from the majority of written languages<\/li>\n\n\n\n<li>Give different charset values to add other languages to your document<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Author and description\n<ul class=\"wp-block-list\">\n<li><code>name= \"author\"<\/code>&nbsp;specifying an author gives credit to who wrote the page<\/li>\n\n\n\n<li><code>name= \"description\"<\/code>&nbsp;giving a description that include keywords relating to your page\u2019s content that help search engines find your website, this is useful in increasing a page\u2019s SEO<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Favicon: a 16 pixel square icon in your browser tab next to the&nbsp;<code>&lt;title&gt;<\/code><\/li>\n\n\n\n<li>Setting the primary language of a document\n<ul class=\"wp-block-list\">\n<li><code>&lt;html lang=\u201den-US\u201d&gt;<\/code>&nbsp;sets the language of the entire document to American English<\/li>\n\n\n\n<li><code>&lt;span lang=\u201dja\u201d&gt;\u3054\u98ef\u304c\u71b1\u3044&lt;\/span&gt;<\/code>&nbsp;sets the language in-between the span tags to Japanese<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">HTML Text Fundamentals<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Header elements\n<ul class=\"wp-block-list\">\n<li>Header elements:&nbsp;<code>&lt;h1&gt;<\/code><code>&lt;h2&gt;<\/code><code>&lt;h3&gt;<\/code><code>&lt;h4&gt;<\/code><code>&lt;h5&gt;<\/code><code>&lt;h6&gt;<\/code>\n<ul class=\"wp-block-list\">\n<li><code>&lt;h1&gt;<\/code>&nbsp;is the largest header element, should only be used once as a title with the other header elements below it in hierarchy<\/li>\n\n\n\n<li><code>&lt;h2&gt;<\/code>&nbsp;should be used to represent sub-subheadings<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Structural hierarchy helps users navigate a page, your use or lack of header elements will affect your search engines will<\/li>\n\n\n\n<li><strong>Semantics<\/strong>&nbsp;are important because using the correct elements gives the content the correct meaning, function, and appearance, using semantics improve your SEO<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Lists<\/li>\n<\/ol>\n\n\n\n<p>Unordered lists<br>&lt;ul&gt;<br>&lt;li&gt; This is a bullet list&lt;\/li&gt;<br>&lt;li&gt; where order is not important&lt;\/li&gt;<br>&lt;li&gt; so bullets or other shapes are used&lt;\/li&gt;<br>&lt;\/ul&gt;<br><br>Ordered lists<br>&lt;ol&gt;<br>&lt;li&gt;This is a numbered list&lt;\/li&gt;<br>&lt;li&gt;where order is important&lt;\/li&gt;<br>&lt;li&gt;so numbers are used&lt;\/li&gt;<br>&lt;\/ol&gt;<br><br>Nesting lists<br>&lt;ul&gt;<br>&lt;li&gt;This is a nested list&lt;\/li&gt;<br>&lt;ol&gt;<br>&lt;li&gt;where there is&lt;\/li&gt;<br>&lt;li&gt;an ordered list&lt;\/li&gt;<br>&lt;\/ol&gt;<br>&lt;li&gt;inside of an unordered list&lt;\/li&gt;<br>&lt;\/ul&gt;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Emphasis and importance <br><span>Tags to know: <\/span><strong> <em> <i> <b> <\/b><\/i><\/em><\/strong>\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 700;font-style: italic\">&lt;strong&gt;&nbsp;<\/span><strong style=\"font-style: italic\">strong emphasis<\/strong><\/li>\n\n\n\n<li><span style=\"font-weight: 700;font-style: italic\">&lt;em&gt;&nbsp;<\/span><em style=\"font-weight: 700\">italic emphasis<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Hyperlinks<\/h2>\n\n\n\n<p><strong>Hyperlinks<\/strong>&nbsp;allow us to link our webpage to another webpage by clicking on them<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Anatomy of a link\n<ul class=\"wp-block-list\">\n<li>Use an&nbsp;<code>&lt;a&gt;<\/code>&nbsp;element and give it a&nbsp;<code>href=\u201cwww.url.com\u201d<\/code>&nbsp;to give the link a destination target<\/li>\n\n\n\n<li>Give it a&nbsp;<code>title=<\/code>&nbsp;attribute to specify information about the link or what kind of information is in the linked website<\/li>\n\n\n\n<li>Block level links are used to turn an image into a link, by putting an&nbsp;<code>&lt;img&gt;<\/code>&nbsp;image tag inside of an&nbsp;<code>&lt;a&gt;<\/code>&nbsp;anchor tag<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>URLs and paths\n<ul class=\"wp-block-list\">\n<li>link within the same directory:&nbsp;<code>&lt;a href=\u201cfilename.html\u201d&gt;<\/code><\/li>\n\n\n\n<li>link down into a subdirectory:&nbsp;<code>&lt;a href=\u201csubfolder\/filename.html\u201d&gt;<\/code><\/li>\n\n\n\n<li>link up into a parent directory:&nbsp;<code>&lt;a href=\u201c..\/filename.html\u201d<\/code><\/li>\n\n\n\n<li>Document fragments- allow you to link to a specific portion of a document by assigning an id attribute to the element you want to link to\n<ul class=\"wp-block-list\">\n<li>Use&nbsp;<code>&lt;a href=\u201cfilename.html#portion_id\u201d&gt;<\/code>&nbsp;to link directly to a specific ID section within a document<\/li>\n\n\n\n<li>or if you&#8217;re jumping to a different section within the same document use&nbsp;<code>&lt;a href=\u201c#portion_id\u201d&gt;<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Absolute versus relative URLs\n<ul class=\"wp-block-list\">\n<li>Absolute URL: absolute location on the web, includes protocol and domain name<\/li>\n\n\n\n<li>Relative URL: does not include the protocol or domain name, used when linking to a page within the same website and therefore assumes it has the same domain, looks for the file being requested on the same server<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Best practices for hyperlinks\n<ul class=\"wp-block-list\">\n<li>Clear link working: use keywords in your link text, don\u2019t include the URL as the link, keep the link text short and descriptive of what it\u2019s linking to, and make your link stand out to users with styling<\/li>\n\n\n\n<li>Use relative links wherever possible because it makes the linked page load faster by skipping the step of looking for the link\u2019s server. The browser just needs to pull up a different file on the same server as the webpage the link is on.<\/li>\n\n\n\n<li>Use clear wording when linking to a non-HTML resource such as a document video\/audio, or requires a flash player to prevent confusion<\/li>\n\n\n\n<li>Use the download attribute when linking to a download<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Email links\n<ul class=\"wp-block-list\">\n<li><code>&lt;a href=\u201dmailto:email@gmail.com\u201d&gt;<\/code><\/li>\n\n\n\n<li><code>mailto:<\/code>&nbsp;opens an outgoing email window with the to: destination already filled in<\/li>\n\n\n\n<li><code>cc=<\/code>&nbsp;fills the CC line (send a public copy of the email)<\/li>\n\n\n\n<li><code>bcc=<\/code>&nbsp;fills the BCC line (send a private copy of the email)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Intro to HTML HTML (Hypertext Markup Language): is a markup language used to tell your browser how to structure web pages HTML comments Metadata The&nbsp;metadata&nbsp;of a document is located in the&nbsp;&lt;head&gt;&nbsp;element, describing the data that\u2019s in the rest of the document, a summary of the website that helps search engines find it HTML Text Fundamentals &hellip; <a href=\"https:\/\/nmi.cool\/advweb\/unit-one-html-css\/week-zero\/html-basics-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Course Notes: HTML Basics<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"parent":3680,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3661","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/comments?post=3661"}],"version-history":[{"count":6,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3661\/revisions"}],"predecessor-version":[{"id":4286,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3661\/revisions\/4286"}],"up":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3680"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/media?parent=3661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}