<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rocco Sangellino</title>
    <description>The latest articles on DEV Community by Rocco Sangellino (@roccosangellino).</description>
    <link>https://dev.to/roccosangellino</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F551140%2F6f1d3a0f-24a3-4ac2-9331-1274fdd826d5.jpg</url>
      <title>DEV Community: Rocco Sangellino</title>
      <link>https://dev.to/roccosangellino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roccosangellino"/>
    <language>en</language>
    <item>
      <title>How To Build a Simple Navbar with HTML and CSS</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 08 Mar 2021 07:18:41 +0000</pubDate>
      <link>https://dev.to/roccosangellino/how-to-build-a-simple-navbar-with-html-and-css-945</link>
      <guid>https://dev.to/roccosangellino/how-to-build-a-simple-navbar-with-html-and-css-945</guid>
      <description>&lt;p&gt;In this week's article, I want to jump right into building a simple navbar using HTML and CSS. Let's take a look at the design we will be building and review the requirements.&lt;/p&gt;

&lt;p&gt;Table of contents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What we are building&lt;/li&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;Implementation&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we are building
&lt;/h2&gt;

&lt;p&gt;We will be building a simple navbar with HTML and CSS. We will use the below design as the guideline for our component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177882752%2FdVtXc61Q_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177882752%2FdVtXc61Q_.png" alt="final-navbar.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;Below are the requirements we need to build the navbar.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navbar background-color is #333333&lt;/li&gt;
&lt;li&gt;Navbar hover background-color is #272727&lt;/li&gt;
&lt;li&gt;Navbar active background-color is #272727&lt;/li&gt;
&lt;li&gt;Text color is #e7e7e7&lt;/li&gt;
&lt;li&gt;Brand font-size is 24px&lt;/li&gt;
&lt;li&gt;Links should have 24px of padding all around&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;RS&lt;/code&gt; should be a link&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;The first thing I do is ask myself what elements might make sense to build a navbar. With HTML we know we have semantic elements we can choose from. In this case, since we know it's a navigation component we will use the &lt;code&gt;nav&lt;/code&gt; element as our wrapping container. Let's also add a class of &lt;code&gt;navbar&lt;/code&gt; so we can apply styles later&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"navbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Next, I would review the content inside the navigation.&lt;/p&gt;

&lt;p&gt;I would split the content into two parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The brand content&lt;/li&gt;
&lt;li&gt;The navigational items&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The reason I would split this up is that the brand content isn't necessarily a navigation item and I want the HTML to have the correct meaning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;Next, let's implement option one from Step 2, The brand content. Since we know from the requirements it needs to be a link I would use the anchor tag. I will also add a class name of &lt;code&gt;brand&lt;/code&gt; so we can style it later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our code should now look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"navbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"brand"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;RS&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615168514625%2FY0x5eV3Vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615168514625%2FY0x5eV3Vt.png" alt="brand-not-styled.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4
&lt;/h3&gt;

&lt;p&gt;Next, let's implement option two from Step 2, the navigational items. I would classify these as a list of links. Keeping with ensuring our HTML structure is semantic I would use a list to structure the items.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our code should now look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"navbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"brand"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;RS&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Blog&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Profile&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615168976306%2Ft1EsSZeQL.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615168976306%2Ft1EsSZeQL.png" alt="navbar-unstyled.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5
&lt;/h3&gt;

&lt;p&gt;Next, let's start adding some styles. I am going to use flexbox (checkout &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;CSS-TRICKS&lt;/a&gt; for an in-depth explanation on flexbox) to align the brand and navigation horizontally and start adding some of the required styles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our styles should now look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* We don't want any links to be underlined. Let's remove that globally */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* let's align the items so everything is nice and centered */&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* We want all links in the navbar to be #e7e7e7 */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615169332899%2FqYExBhiv3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615169332899%2FqYExBhiv3.png" alt="navbar-begin-styles.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6
&lt;/h3&gt;

&lt;p&gt;Next, let's style the list. Since we want the list to be horizontal we can use flexbox again to achieve this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our list styles should look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;/* Let's reset the margin and padding of the list so it's is flush. */&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* Let's remove the bullet points */&lt;/span&gt;
  &lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* display the list flex and align the items centered */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Overall, our styles should look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* We don't want any links to be underlined. Let's remove that globally */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* let's align the items so everything is nice and centered */&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* We want all links in the navbar to be #e7e7e7 */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;/* Let's reset the margin and padding of the list so it's is flush. */&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* Let's remove the bullet points */&lt;/span&gt;
  &lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* display the list flex and align the items centered */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615176874652%2Fho-RJzRBx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615176874652%2Fho-RJzRBx.png" alt="navbar-list-flex.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7
&lt;/h3&gt;

&lt;p&gt;Next, let's style the brand and navigation links. We need to add the spacing around the brand and links.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our link and brand styles should look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nc"&gt;.brand&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="c"&gt;/* Remove padding from top/bottom and add 24px padding right/left */&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/*Let's make the anchor display block.
     This will ensure when we hover, focus, or is active we get the full width and height 
      of the container.
  */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* When a use hovers or focuses to a link change the background */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Overall, our styles should look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* We don't want any links to be underlined. Let's remove that globally */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* let's align the items so everything is nice and centered */&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* We want all links in the navbar to be #e7e7e7 */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;/* Let's reset the margin and padding of the list so it's is flush. */&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* Let's remove the bullet points */&lt;/span&gt;
  &lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* display the list flex and align the items centered */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nc"&gt;.brand&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/*Let's make the anchor display block.
     This will ensure when we get the full width of the container.
  */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="c"&gt;/* Remove padding from top/bottom and add 24px padding right/left */&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/*Let's make the anchor display block.
     This will ensure when we hover, focus, or is active we get the full width and height 
      of the container.
  */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* When a use hovers or focuses a link change the background */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177552191%2FjHyO0PCVZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177552191%2FjHyO0PCVZ.png" alt="navbar-without-active.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8
&lt;/h3&gt;

&lt;p&gt;Next, we need one final piece, styling the active navigation link.&lt;/p&gt;

&lt;p&gt;First, let's update the HTML to add the &lt;code&gt;active&lt;/code&gt; class to the &lt;code&gt;About&lt;/code&gt; link.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"navbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"brand"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;RS&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Blog&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"active"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Profile&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let's add the &lt;code&gt;active&lt;/code&gt; style. Since the active style is the same as focus and hover we can add the active styles to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nc"&gt;.active&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Overall, our styles should look like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* We don't want any links to be underlined. Let's remove that globally */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* let's align the items so everything is nice and centered */&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* We want all links in the navbar to be #e7e7e7 */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;/* Let's reset the margin and padding of the list so it's is flush. */&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* Let's remove the bullet points */&lt;/span&gt;
  &lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* display the list flex and align the items centered */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nc"&gt;.brand&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/*Let's make the anchor display block.
     This will ensure when we get the full width of the container.
  */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="c"&gt;/* Remove padding from top/bottom and add 24px padding right/left */&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e7e7e7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/*Let's make the anchor display block.
     This will ensure when we hover, focus, or is active we get the full width and height 
      of the container.
  */&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* When a user hovers, focuses or if the link is active change the background */&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.navbar&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="nc"&gt;.active&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177882752%2FdVtXc61Q_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1615177882752%2FdVtXc61Q_.png" alt="final-navbar.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full code below via codepen:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/rjs84/embed/QWGZLQR?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With some basic knowledge of HTML and CSS, we were able to create a fully functioning navbar component.&lt;/p&gt;

&lt;p&gt;If you haven't already please follow me on Twitter (&lt;a href="https://twitter.com/RoccoSangellino" rel="noopener noreferrer"&gt;@RoccoSangllino&lt;/a&gt;) where I share more information on web development.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is semantic HTML?</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 01 Mar 2021 03:45:49 +0000</pubDate>
      <link>https://dev.to/roccosangellino/what-is-semantic-html-43em</link>
      <guid>https://dev.to/roccosangellino/what-is-semantic-html-43em</guid>
      <description>&lt;p&gt;When starting to learn HTML you will hear the term &lt;em&gt;semantic markup&lt;/em&gt;. What does this mean and why is it important? Let's break it down and take a look at some examples.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is semantic HTML?&lt;/li&gt;
&lt;li&gt;Why is this important?&lt;/li&gt;
&lt;li&gt;Examples of semantic elements&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is semantic HTML?
&lt;/h2&gt;

&lt;p&gt;Before we dive into semantic HTML let's define &lt;em&gt;semantics&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;semantics&lt;/strong&gt; is the study of meanings. - &lt;a href="https://www.merriam-webster.com/dictionary/semantics"&gt;Merriam-Webster&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When we write our HTML structure we want to ensure we give it meaning. HTML provides a set of tags we can use to build the structure of our document. We want to consider the meaning of these tags so we can appropriately layout our site in such a way another developer, browser, and assistive technologies can understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is this important?
&lt;/h2&gt;

&lt;p&gt;There are two main reasons why this is important:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It makes it easier to read the HTML. When you are reading through the document and see the element &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; right away you know that consists of some type of navigation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's a great start to providing accessible websites. Assistive technologies, specifically a screen reader, will scan the document to get information. It helps assistive technologies to better associate the content of the site. For example, screen readers allow users to skip content based on headings, so ensuring you are using the correct heading structure and not skipping heading levels is important.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Examples of semantic elements
&lt;/h2&gt;

&lt;p&gt;Below are some examples of semantic elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; - used to gather user input.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; - used for creating paragraphs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; - used to define the header of the document or section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; - used to group related content.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; - used to provide a footer for the main document or a section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; - used as the container element for navigation links.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h1-h6&amp;gt;&lt;/code&gt; - defines the heading levels of the document.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;main&lt;/code&gt;&amp;gt; - used to define the main content of the site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Semantic markup is used to give our document structure meaning. It provides developers a better understanding of the document and allows assistive technologies to do their jobs better.&lt;/p&gt;

&lt;p&gt;If you haven't already please follow me on Twitter (&lt;a href="https://twitter.com/RoccoSangellino"&gt;@RoccoSangllino&lt;/a&gt;) where I share more information on web development.&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>HTML Body Tag Explained</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 22 Feb 2021 06:29:56 +0000</pubDate>
      <link>https://dev.to/roccosangellino/html-body-tag-explained-2hfn</link>
      <guid>https://dev.to/roccosangellino/html-body-tag-explained-2hfn</guid>
      <description>&lt;p&gt;In this article, we are going to continue our Basic HTML series. Over the last couple of weeks, I have discussed basic HTML structure (&lt;a href="https://blog.roccosangellino.com/basic-html-structure-explained"&gt;Basic HTML Structure Explained&lt;/a&gt;) and explained what the head tag is (&lt;a href="https://blog.roccosangellino.com/html-head-tag-explained"&gt;HTML Head Tag Explained&lt;/a&gt;). This week let's take a look at what the &lt;code&gt;body&lt;/code&gt; tag is and some common elements you will see contained inside the &lt;code&gt;body&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the body tag?&lt;/li&gt;
&lt;li&gt;Common HTML Elements&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is the body tag?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;body&lt;/code&gt; tag is a container element that holds the contents of the site. Anything you potentially want visible to the user will go inside the body tag.&lt;/p&gt;

&lt;p&gt;For example, if I want to display "Hello World" I would do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Rocco Sangellino"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Basic html body tag explained"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;What is the body tag&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    Hello World!
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4XN_QICB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1613967420514/V7EC7s3mK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4XN_QICB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1613967420514/V7EC7s3mK.png" alt="hello-world-html.png" width="662" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that basic example, you created a web page! Since the &lt;code&gt;body&lt;/code&gt; tag is a container that holds the contents of the site we can now expand on this and start to add other elements inside such as headers, navigation, sections, paragraphs, tables, forms, etc. Let's take a look at some common elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common HTML Elements
&lt;/h2&gt;

&lt;p&gt;HTML provides us with many elements that we can use to structure our site. Below are some common elements you will encounter when building a website:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;div&lt;/code&gt; - The &lt;code&gt;div&lt;/code&gt; tag stands for "division". In other words, it's a generic container that holds other elements or text. It can be used to "divide" your sites into different sections.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    I am a container that can hold other HTML elements.
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/zYoEZyV?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;span&lt;/code&gt;The &lt;code&gt;span&lt;/code&gt; tag is similar to a &lt;code&gt;div&lt;/code&gt;, in that it's a container. The difference being a &lt;code&gt;div&lt;/code&gt; is a block-level element and the &lt;code&gt;span&lt;/code&gt; is an inline element.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;I am mostly used to markup text or other inline elements like icons.&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/GRNMWaE?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;h1-h6&lt;/code&gt; The &lt;code&gt;h1-h6&lt;/code&gt; tag defines the heading layout of the site. Generally, you will have one &lt;code&gt;h1&lt;/code&gt; and each subsequent heading should be nested according. As we will be learning in future articles this is important for semantic markup and screen readers.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/ZEBXeNP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;section&lt;/code&gt; - The &lt;code&gt;section&lt;/code&gt; tag is the same as a &lt;code&gt;div&lt;/code&gt; in that it is a block-level container that defines a section of the site. The difference is a &lt;code&gt;section&lt;/code&gt; has semantic meaning where a &lt;code&gt;div&lt;/code&gt; does not.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;About Me&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hello! My name is Rocco. Thank you for reading my blog.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/LYbzWKG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;p&lt;/code&gt; - The &lt;code&gt;p&lt;/code&gt; tag is used for paragraphs.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I would put my bio in a paragraph tag.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/yLVzMdG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;table&lt;/code&gt; - The &lt;code&gt;table&lt;/code&gt; tag is used for tabular data. The table tag will contain other elements to fill out a complete table. Such as: &lt;code&gt;thead&lt;/code&gt;, &lt;code&gt;tbody&lt;/code&gt;, &lt;code&gt;tr&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt;, and &lt;code&gt;td&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Name&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Email&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Phone&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;Rocco Sangellino&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;example@gmail.com&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;111-111-1111&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/abBLJxo?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;a&lt;/code&gt; - the &lt;code&gt;a&lt;/code&gt; tag stand for "anchor" or hyperlink. In order words, it enables you to link to other websites on the internet.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://blog.roccosangellino.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Rocco's Blog&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/oNYGZKx?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ul&lt;/code&gt; - The &lt;code&gt;ul&lt;/code&gt; stand for an unordered list. This allows you to add a bulleted list to your site.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"http://twitter.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Rocco's Twitter&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://blog.roccosangellino.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Rocco's Blog&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Rendered HTML:&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rjs84/embed/bGBoqXv?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/tags/default.asp"&gt;w3schools&lt;/a&gt; has a comprehensive list of HTML tags with examples. I encourage you to take a look.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we learned that the &lt;code&gt;body&lt;/code&gt; tag is a container element that holds the contents of a website. Anything you want visible to the user will go inside the &lt;code&gt;body&lt;/code&gt; tag. With this basic understanding, you can start to create web pages. However, we have just scratched the surface of building sites. Let's pick up in the next article discussing what semantic markup is and why it's important.&lt;/p&gt;

&lt;p&gt;If you haven't already please follow me on Twitter (&lt;a href="https://twitter.com/RoccoSangellino"&gt;@RoccoSangllino&lt;/a&gt;) where I share more information on web development.&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>HTML Head Tag Explained</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 15 Feb 2021 06:36:48 +0000</pubDate>
      <link>https://dev.to/roccosangellino/html-head-tag-explained-o7g</link>
      <guid>https://dev.to/roccosangellino/html-head-tag-explained-o7g</guid>
      <description>&lt;p&gt;In last week's blog post &lt;a href="https://dev.to/roccosangellino/basic-html-structure-explained-3h4j"&gt;&lt;code&gt;Basic HTML structure explained&lt;/code&gt;&lt;/a&gt; I covered the basics of HTML structure. In this article let's go more in-depth on the purpose of the &lt;code&gt;head&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the head tag?&lt;/li&gt;
&lt;li&gt;Title Tag&lt;/li&gt;
&lt;li&gt;Meta Tag&lt;/li&gt;
&lt;li&gt;Link Tag&lt;/li&gt;
&lt;li&gt;Style Tag&lt;/li&gt;
&lt;li&gt;Script Tag&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is the &lt;code&gt;head&lt;/code&gt; tag?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;head&lt;/code&gt; tag is a container that holds metadata about the document. Metadata is information that describes other data. For example, the author or created date associated with this blog post would be considered metadata. The information we place in the &lt;code&gt;head&lt;/code&gt; tag is not visible to the user. The data in the &lt;code&gt;head&lt;/code&gt; tag can be used by the browser to set the document title, character set, styles, scripts, author, keywords, and other data we will see below.&lt;/p&gt;

&lt;p&gt;Basic example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Rocco Sangellino"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Basic html tag explained"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My awesome document title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let take a look at &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;meta&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;style&lt;/code&gt;, and &lt;code&gt;script&lt;/code&gt; more in-depth.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;title&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;title&lt;/code&gt; tag sets the title of the document. The title is displayed in the browser tab.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My awesome document title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f5G44J0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1613367002266/oypeDw5Sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f5G44J0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1613367002266/oypeDw5Sw.png" alt="example-title.png" width="880" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;meta&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;meta&lt;/code&gt; tag allows you to add metadata about a document. The data is not visible to the user but used by browsers and search engines. The browser may use the data to determine content about the site such as character set and viewport. You can also target search engines by using the &lt;code&gt;meta&lt;/code&gt; tag to add keywords to the site.&lt;/p&gt;

&lt;p&gt;Let's say I want to enhance my SEO rankings by adding some keywords to my site. Below is an example of how we can use the meta tag to achieve this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"keywords"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"HTML"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt; are attributes. Attributes allow us to provide the extra data needed. Think of attributes as key/value pairs where &lt;code&gt;name&lt;/code&gt; is the key and &lt;code&gt;keywords&lt;/code&gt; is the value. I will go more in-depth on attributes in a future article.&lt;/p&gt;

&lt;p&gt;To build on our example above let's provide the author of the document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Rocco Sangellino"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To help to ensure the site renders properly on different devices we can tell the browser how to control the dimensions and scaling of the site. We do this by adding the attribute &lt;code&gt;name&lt;/code&gt; with a value of &lt;code&gt;viewport&lt;/code&gt; to the &lt;code&gt;meta&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see the meta tag is powerful. It helps us provide the browser and search engines extra data to help bolster our site.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;link&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;link&lt;/code&gt; tag is used to tell the browser the relationship between the current document and an external resource. In most cases, the external resource is a stylesheet. Another common use case is to specify the favicon of the document which is the icon of the site. To link an external resource (i.e. stylesheet), we supply the &lt;code&gt;link&lt;/code&gt; tag with a couple of attributes.&lt;/p&gt;

&lt;p&gt;For example, let's say we want to link the &lt;code&gt;style.css&lt;/code&gt; resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we have two attributes &lt;code&gt;rel&lt;/code&gt; and &lt;code&gt;href&lt;/code&gt;. The &lt;code&gt;rel&lt;/code&gt; attribute stands for relationship. We are specifying how the link is related to the current document. In this case, we want the relationship to be a stylesheet. The &lt;code&gt;href&lt;/code&gt; attribute specifies the location of the resource. In this case, the resource is located in the current directory of the site.&lt;/p&gt;

&lt;p&gt;Before moving on let's take a look at one more example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"favicon.ico"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we are specifying the relationship of the link to the current document to be an icon. Next, we provide the path to the icon in the &lt;code&gt;href&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;There are many more attributes that can be provided. A full list can be found at &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link"&gt;developer.mozilla.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;style&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;style&lt;/code&gt; tag allows us to add styles to the document without linking to an external resource. Often you will see &lt;code&gt;type&lt;/code&gt; and &lt;code&gt;media&lt;/code&gt; attributes on a &lt;code&gt;style&lt;/code&gt; tag. There are a few others however, type and media are most popular.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, I supplied the &lt;code&gt;type&lt;/code&gt; attribute, however, modern browsers will use &lt;code&gt;text/css&lt;/code&gt; as the default value if &lt;code&gt;type&lt;/code&gt; isn't supplied.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; For a more in-depth list you can check them out at &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style"&gt;developer.mozilla.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;script&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;script&lt;/code&gt; tag provides two ways to include JavaScript in our websites. Similar to the &lt;code&gt;link&lt;/code&gt; tag we can link to an external resource or similar to the &lt;code&gt;style&lt;/code&gt; tag we can include code right in the document.&lt;/p&gt;

&lt;p&gt;To link to an external resource, we must provide the &lt;code&gt;scr&lt;/code&gt; attribute to the &lt;code&gt;script&lt;/code&gt; tag. The &lt;code&gt;src&lt;/code&gt; attribute tells the browser where it can find the resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is an example of adding the code in the current document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, the &lt;code&gt;script&lt;/code&gt; tag can be used in the &lt;code&gt;body&lt;/code&gt; tag. Using it in the &lt;code&gt;head&lt;/code&gt; tag is just one option.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;  The &lt;code&gt;script&lt;/code&gt; tag can be used with other languages and has many more attributes. For more in-depth information you can check out at &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script"&gt;developer.mozilla.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we continued our discussion on basic HTML setup by exploring the use of the &lt;code&gt;head&lt;/code&gt; tag. While there are many more attributes and use cases to be learned this information should get you started. Be on the lookout for more HTML articles in the weeks to come.&lt;/p&gt;

&lt;p&gt;If you haven't already please follow me on &lt;a href="https://twitter.com/RoccoSangellino"&gt;Twitter&lt;/a&gt; where I share more information on web development.&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Basic HTML Structure Explained</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 08 Feb 2021 16:43:11 +0000</pubDate>
      <link>https://dev.to/roccosangellino/basic-html-structure-explained-3h4j</link>
      <guid>https://dev.to/roccosangellino/basic-html-structure-explained-3h4j</guid>
      <description>&lt;p&gt;HTML is one of the first building blocks to learn how to build websites. There are a set of rules that must be followed in order to build HTML documents. Let's break down the basic structure of an HTML document to help us start building websites.&lt;/p&gt;

&lt;p&gt;Table of Contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is HTML?&lt;/li&gt;
&lt;li&gt;Basic HTML Structure&lt;/li&gt;
&lt;li&gt;What is a Tag?&lt;/li&gt;
&lt;li&gt;What is a &lt;code&gt;DOCTYPE&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;What is the &lt;code&gt;html&lt;/code&gt; tag?&lt;/li&gt;
&lt;li&gt;What is the &lt;code&gt;head&lt;/code&gt; tag?&lt;/li&gt;
&lt;li&gt;What is the &lt;code&gt;body&lt;/code&gt; tag?&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is HTML?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt; (Hyper Text Markup Language) is the most widely used markup language in existence. HTML is the primary markup language used to build websites. It was born out of &lt;a href="https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language"&gt;SGML&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt; in the early nineties. HTML is used to semantically define the &lt;em&gt;structure&lt;/em&gt; of a document.&lt;/p&gt;

&lt;p&gt;Since the early days of the web, there have been many versions of HTML:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Version&lt;/th&gt;
            &lt;th&gt;Year&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML&lt;/td&gt;
            &lt;td&gt;1991&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML+&lt;/td&gt;
            &lt;td&gt;1993&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML 2.0&lt;/td&gt;
            &lt;td&gt;1995&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML 3.2&lt;/td&gt;
            &lt;td&gt;1997&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML 4.01&lt;/td&gt;
            &lt;td&gt;1999&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;XHTML&lt;/td&gt;
            &lt;td&gt;2000&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;HTML5&lt;/td&gt;
            &lt;td&gt;2012&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Basic HTML Structure
&lt;/h2&gt;

&lt;p&gt;HTML is written using a nested structure of tags. When the web page is loaded the browser interprets the tags and renders the document.&lt;/p&gt;

&lt;p&gt;Below is an example of a basic &lt;code&gt;HTML&lt;/code&gt; document. Let's break down each piece on the sections below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is a Tag?
&lt;/h2&gt;

&lt;p&gt;Tags are keywords the browser uses to determine how to render an HTML document. Tags that have content require an open and closing tag. For example: &lt;code&gt;&amp;lt;div&amp;gt;Content&amp;lt;/div&amp;gt;&lt;/code&gt;. Not all tags require content, so in those cases we can condense an open and closing tag into one. We call that a self closing tag. For example: &lt;code&gt;&amp;lt;br /&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a &lt;code&gt;DOCTYPE&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;The DOCTYPE sets the parsing and validation rules of a document. This ensures different browsers use the same set of rules. Since HTML has many different versions it's important to specify which rules the browser should follow. Below are a couple example of different &lt;code&gt;doctypes&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Html 5 doctype --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Html 4.01 strict doctype --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"    "http://www.w3.org/TR/html4/strict.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Html 4.01 strict doctype --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"    "http://www.w3.org/TR/html4/strict.dtd"&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can read more about &lt;code&gt;doctype&lt;/code&gt; at the &lt;a href="https://www.w3.org/QA/2002/04/valid-dtd-list.html"&gt;W3C&lt;/a&gt; site.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the &lt;code&gt;html&lt;/code&gt; tag?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;html&lt;/code&gt; tag is the root element of the document. This should be added immediately after the &lt;code&gt;doctype&lt;/code&gt;. Within the &lt;code&gt;html&lt;/code&gt; element, we separate the rest of our HTML code into two elements, the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the &lt;code&gt;head&lt;/code&gt; tag?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;head&lt;/code&gt; tag will generally contain information about the document. Everything in the &lt;code&gt;head&lt;/code&gt; tag will not be visible to the user, but are important to the browser. Inside the &lt;code&gt;head&lt;/code&gt; tag we can define meta data (&lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt;), document title (&lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;), styles (&lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt;), and scripts (&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; I will go more in-depth on each of these tags in a future blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the &lt;code&gt;body&lt;/code&gt; tag?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag is where we put all our content. Anything that we want visible to the user will go inside the &lt;code&gt;body&lt;/code&gt; tag. This is where the bulk of your HTML will be written. Everything from headers to images, paragraphs, tables, and forms will all end up here. Learning the various kind of HTML tags will allow you to build the body of the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Knowing HTML is essential to building websites. This article covered the basic layout of an HTML document. Checkout back for more in-depth articles about HTML tags and how they can be used to build a site.&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is http://localhost:8080?</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Mon, 01 Feb 2021 18:42:20 +0000</pubDate>
      <link>https://dev.to/roccosangellino/what-is-http-localhost-8080-224l</link>
      <guid>https://dev.to/roccosangellino/what-is-http-localhost-8080-224l</guid>
      <description>&lt;p&gt;Recently I was a part of a conversation on twitter where Danny asked a great question. "What is localhost:8080"? In this article let's break it down, and defined what the means.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1352713206263853057-160" src="https://platform.twitter.com/embed/Tweet.html?id=1352713206263853057"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1352713206263853057-160');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1352713206263853057&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Before we can define what &lt;code&gt;http://localhost:8080&lt;/code&gt; is we need understand some basic concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is an Internet Protocol Address (IP)&lt;/li&gt;
&lt;li&gt;Domain Name&lt;/li&gt;
&lt;li&gt;Port Number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Putting it all together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is http://localhost:8080?&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is an Internet Protocol Address (IP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The information below is simply a high level overview. Comment below or message me on &lt;a href="https://twitter.com/RoccoSangellino" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; if you want a more in-depth overview.&lt;/p&gt;

&lt;p&gt;IP stands for Internet Protocol, which is a set of rules that allows devices to communicate over the internet. An address, in this context is similar to a person or business mailing address, but for a machine/computer/server instead. There are billions of devices all over the world, and an IP address is how we locate and communicate with them. &lt;/p&gt;

&lt;p&gt;There are two types of IP addresses, Internet Protocol Version 4 (&lt;code&gt;**IPv4**&lt;/code&gt;) and Internet Protocol Version 6 (&lt;code&gt;**IPv6**&lt;/code&gt;). The below definitions were taken from &lt;a href="https://en.wikipedia.org/wiki/IP_address" rel="noopener noreferrer"&gt;wikipedia&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IPv4&lt;/strong&gt; is usually represented in dot-decimal format consisting of four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., &lt;em&gt;172.16.254.1&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IPv6&lt;/strong&gt; address is represented as eight groups of four hexadecimal digits, each group representing 16 bits (two octets, a group sometimes also called a hextet[6][7]). The groups are separated by colons (:). An example of an IPv6 address is: &lt;em&gt;2001:0db8:85a3:0000:0000:8a2e:0370:7334&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Fun Fact:&lt;/strong&gt; Did you know the world is running out of IPv4 addresses?!?! Here are a couple of resources to check out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.noction.com/blog/ipv4-run-out" rel="noopener noreferrer"&gt;The IPv4 party is over&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/IPv4_address_exhaustion" rel="noopener noreferrer"&gt;IPv4 address exhaustion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Domain Name
&lt;/h2&gt;

&lt;p&gt;A domain name like &lt;code&gt;google.com&lt;/code&gt; are human readable names that map to an IP address, the device or in this case a web server that is hosting &lt;code&gt;google.com&lt;/code&gt;. Anytime you enter a domain name in a browser it has to go through a Domain Name System (&lt;strong&gt;DNS&lt;/strong&gt;) resolver. DNS takes the "friendly" name of &lt;code&gt;google.com&lt;/code&gt; and does a lookup to find googles IP address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Port Number
&lt;/h2&gt;

&lt;p&gt;A port number is a 16-bit unsigned integer ranging from 0 to 65535.  Since an IP is the address of a device, and that device can have many processes running on it such as: a web server, ftp server, mail server, it needs a way of knowing which process to respond to so it can respond to the request correctly.&lt;/p&gt;

&lt;p&gt;There are two important port numbers to know for web development: &lt;code&gt;80&lt;/code&gt; and &lt;code&gt;443&lt;/code&gt;. Port &lt;code&gt;80&lt;/code&gt; is the default port number used for &lt;strong&gt;HTTP&lt;/strong&gt; requests and &lt;code&gt;443&lt;/code&gt; is used to &lt;strong&gt;HTTPS&lt;/strong&gt; requests. If you are interested you can check out &lt;a href="https://en.wikipedia.org/wiki/Port_(computer_networking)" rel="noopener noreferrer"&gt;wikipedia&lt;/a&gt; for a list of well known port numbers and what processes they are used for.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;code&gt;http://localhost:8080&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Now that we have learned the basics let's break this url down into three separate pieces to make it easier to understand:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;http&lt;/code&gt; is the HTTP protocol we want to use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;localhost&lt;/code&gt; is the domain name, i.e. the friendly name of the device we want to access. In this case it's the machine you are developing on.&lt;/p&gt;

&lt;p&gt;In almost all cases &lt;code&gt;localhost&lt;/code&gt; is mapped to the IP address of &lt;code&gt;127.0.0.1&lt;/code&gt; on your machine. These settings can be overridden in your machines host file. A host file on an operating system maps hostnames to specific IP addresses. However, I only recommend changing these settings if you are familiar with the host file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example host file:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1612203843398%2Fztu2HZWLI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1612203843398%2Fztu2HZWLI.png" alt="example host file"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;8080&lt;/code&gt; is the port number that we want our device to respond to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;  The &lt;code&gt;8080&lt;/code&gt; port number could have be any port above the restricted port range. The development server happen to pick port &lt;code&gt;8080&lt;/code&gt;. If this port was already in use some servers will increment until they find an open port. For example, if I have two VueJS applications running, one will run on port &lt;code&gt;8080&lt;/code&gt;, and the other will run on port &lt;code&gt;8081&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Putting all the pieces together when we enter &lt;code&gt;http://localhost:8080&lt;/code&gt; into a browser we are making a HTTP request to our local development web server at the &lt;code&gt;localhost&lt;/code&gt; domain listening to process messages on port &lt;code&gt;8080&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Please follow Danny (&lt;a href="https://twitter.com/100days100" rel="noopener noreferrer"&gt;@100days100&lt;/a&gt;) on twitter as he documents his journey into web development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to setup your machine to use Docker and WordPress</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Sun, 24 Jan 2021 23:19:53 +0000</pubDate>
      <link>https://dev.to/roccosangellino/how-to-setup-your-machine-to-use-docker-and-wordpress-49d1</link>
      <guid>https://dev.to/roccosangellino/how-to-setup-your-machine-to-use-docker-and-wordpress-49d1</guid>
      <description>&lt;p&gt;When building a website using WordPress often times you will want a development environment to work with before pushing to production. There are a few different ways to achieve this goal. In this article we are going to see how to setup WordPress using docker. This article will assume you are somewhat familiar with WordPress and using either a Mac or Windows machine. If you are unfamiliar with WordPress please check out &lt;a href="https://wordpress.org/" rel="noopener noreferrer"&gt;wordpress.org&lt;/a&gt; for more details.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Docker?&lt;/li&gt;
&lt;li&gt;Container&lt;/li&gt;
&lt;li&gt;Installing Docker&lt;/li&gt;
&lt;li&gt;Setting up WordPress&lt;/li&gt;
&lt;li&gt;Stopping the WordPress Container&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is Docker?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: If you are familiar with Docker you can skip this step.&lt;/p&gt;

&lt;p&gt;First let's briefly talk about what docker is. According to the &lt;a href="https://docs.docker.com/get-started/overview/" rel="noopener noreferrer"&gt;docker&lt;/a&gt; website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. Docker provides the ability to package and run an application in a loosely isolated environment called a &lt;strong&gt;container&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I bolded the word &lt;code&gt;container&lt;/code&gt; because it's worth noting that &lt;code&gt;docker&lt;/code&gt; itself is not a container. It provides the means to run containers (more on containers below). You will often come across docker being talked about as if it were a container. One reason for this is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Because of the popularity and explosive growth of Docker in the community, it has become synonymous with containers. The term “docker” can refer to the software as a whole, the command line application, the company, or interchangeably with the word “container”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A friend of mine, Rob Sigrest (learn more about him on his &lt;a href="https://github.com/rsigrest" rel="noopener noreferrer"&gt;github&lt;/a&gt; page) gave a presentation and came to that conclusion above with his experience in the industry. &lt;/p&gt;

&lt;h2&gt;
  
  
  Container
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: If you are familiar with what a container is you can skip this step.&lt;/p&gt;

&lt;p&gt;Now that we know docker is the software that can run a container what is a container? According to the &lt;a href="https://www.docker.com/resources/what-container" rel="noopener noreferrer"&gt;docker&lt;/a&gt; website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simplest terms, a container allows you to run your application code segregated from other code on your system. This eliminates the need to install all of the necessary dependencies on your local machine. For example, as we will see later I use docker to run WordPress without having to install all the dependencies WordPress requires such as apache, php, and MySQL.&lt;/p&gt;

&lt;p&gt;A major benefit Rob mentioned during his presentation is a container images can be run on any platform with a compatible container runtime. So for example, you could run containers in production on a Linux system but develop them using the same container runtime (like Docker) on Windows or Mac.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Docker
&lt;/h2&gt;

&lt;p&gt;Now that we got the definitions out of the way let's get to the fun part, installing docker and running WordPress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: If you already have docker installed you can skip this step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download and install docker desktop &lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Follow the instructions all the way through. At some point in the installation it will ask you for your system password. You will need to provide docker with your password because docker needs elevated permissions to perform some tasks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Side Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When docker desktop is installed it will install a tool called &lt;code&gt;docker-compose&lt;/code&gt;. This is important because we will be using this to run our containers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. - Docker website&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Setting up WordPress
&lt;/h2&gt;

&lt;p&gt;Now that we have &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;docker-compose&lt;/code&gt; installed let's get WordPress up and running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: If you already have a location where you like to create your projects you can skip steps 1-3 and navigate to that directory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open your terminal and type the following command:&lt;/p&gt;

&lt;p&gt;Mac&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Windows&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; %userprofile%
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;The above command will change directory (&lt;code&gt;cd&lt;/code&gt;) to our home folder&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the Projects directory&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;Projects
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;em&gt;The above command will create a directory (&lt;code&gt;mkdir&lt;/code&gt;) called &lt;code&gt;Projects&lt;/code&gt; in our home directory.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change directory to Projects&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;Projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the WordPress directory inside the &lt;code&gt;Projects&lt;/code&gt; directory&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change directory to WordPress&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;wordpress
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;To confirm your terminal should look something like:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611520398417%2Fq_D48im1Z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611520398417%2Fq_D48im1Z.png" alt="terminal.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;wordpress&lt;/code&gt; folder in your text editor. I am using VS Code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a file called &lt;code&gt;docker-compose.yaml&lt;/code&gt; and enter the below contents:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: It is important the file is called &lt;code&gt;docker-compose.yaml&lt;/code&gt; otherwise &lt;code&gt;docker-compose&lt;/code&gt; won't work.&lt;/p&gt;

&lt;p&gt;Source file from Brad Traversy's &lt;a href="https://gist.github.com/bradtraversy/faa8de544c62eef3f31de406982f1d42" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# Database&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mysql:5.7&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db_data:/var/lib/mysql&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;password&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_DATABASE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;wpsite&lt;/span&gt;
  &lt;span class="c1"&gt;# phpmyadmin&lt;/span&gt;
  &lt;span class="na"&gt;phpmyadmin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;phpmyadmin/phpmyadmin&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;8080:80'&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;PMA_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;password&lt;/span&gt; 
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;wpsite&lt;/span&gt;
  &lt;span class="c1"&gt;# Wordpress&lt;/span&gt;
  &lt;span class="na"&gt;wordpress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress:latest&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;8000:80'&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;./:/var/www/html'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db:3306&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;wpsite&lt;/span&gt;
&lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;wpsite&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db_data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Your text editor should look something like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611522873607%2FEeXDLOkYk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611522873607%2FEeXDLOkYk.png" alt="docker-compose-file.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above &lt;code&gt;docker-compose.yaml&lt;/code&gt; file will pull three containers: &lt;code&gt;MySQL&lt;/code&gt;, &lt;code&gt;phpmyadmin&lt;/code&gt;, and &lt;code&gt;WordPress&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SIDE NOTE:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I won't be explaining all the properties here, however I want to take a minute and explain the &lt;code&gt;volumes&lt;/code&gt; and &lt;code&gt;ports&lt;/code&gt; property. &lt;/p&gt;

&lt;p&gt;When we specify &lt;code&gt;volumes: ['./:/var/www/html']&lt;/code&gt;, what this means is docker will mount our local systems directory of &lt;code&gt;.&lt;/code&gt;, meaning our current directory (in our case &lt;code&gt;wordpress&lt;/code&gt;), to &lt;code&gt;/var/www/html&lt;/code&gt; inside the container. &lt;code&gt;/var/www/html&lt;/code&gt; is where the source code for WordPress is stored in the container. This will allow us to develop our plugin or theme on our local machine and be available to the container. &lt;/p&gt;

&lt;p&gt;When we specify &lt;code&gt;'8000:80'&lt;/code&gt; in the &lt;code&gt;ports&lt;/code&gt; sections of the config we are telling the docker to map our local system &lt;code&gt;8000&lt;/code&gt; port to the containers port &lt;code&gt;80&lt;/code&gt;. Port &lt;code&gt;80&lt;/code&gt; in the container is the port our WordPress is running. However, we want to be able to access this on our local machine so we need to map a port from our local machine to the container port running the site.&lt;/p&gt;

&lt;p&gt;You can learn more about what each of these properties are at &lt;a href="https://docs.docker.com/compose/compose-file/compose-file-v3/" rel="noopener noreferrer"&gt;dockers website&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let's head back to the terminal and navigate to our &lt;code&gt;wordpress&lt;/code&gt; directory&lt;/p&gt;

&lt;p&gt;Mac users&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Projects/wordpress
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Windows users&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; %userprofile%&lt;span class="se"&gt;\P&lt;/span&gt;rojects&lt;span class="se"&gt;\w&lt;/span&gt;ordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now that we are in our &lt;code&gt;wordpress&lt;/code&gt; directory let's start up our containers&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This step might take a few minutes as docker will need to pull all the above images from our &lt;code&gt;docker-compose.yaml&lt;/code&gt; file. You should also see output in the terminal that looks something like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611518730082%2FCg_lYKY_p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611518730082%2FCg_lYKY_p.png" alt="docker-compose-output.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should now start to see files and folders being added to the &lt;code&gt;wordpress&lt;/code&gt; directory. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611518918308%2FJyazRYMDI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611518918308%2FJyazRYMDI.png" alt="vs-code-output.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above command will start the containers in &lt;code&gt;detached mode&lt;/code&gt;, meaning it will run in the background and you can close your terminal if you like when it has completed all the downloads.&lt;/p&gt;

&lt;p&gt;At this point we should be able to access our WordPress site at &lt;code&gt;http://localhost:8000&lt;/code&gt; and phpmyadmin at &lt;code&gt;http://localhost:8080&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611472285498%2FIHGUCCOuO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611472285498%2FIHGUCCOuO.png" alt="wordpress-install.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the language you want to use and click &lt;code&gt;Continue&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519295191%2FvORXIvYcB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519295191%2FvORXIvYcB.png" alt="wordpress-step2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill out your sites details and click &lt;code&gt;Install WordPress&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519446085%2F1p-wHHJCI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519446085%2F1p-wHHJCI.png" alt="wordpress-step3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SUCCESS!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519498610%2FepdyZAgJw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1611519498610%2FepdyZAgJw.png" alt="wordpress-step4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations&lt;/strong&gt; you now installed WordPress using Docker! You can build your plugins and themes as you normally would inside &lt;code&gt;wordpress/wp-content/&lt;/code&gt; directory.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Stopping the WordPress Container
&lt;/h2&gt;

&lt;p&gt;Once we are done building our site and we no longer need our containers running there are two ways to achieve this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to &lt;code&gt;~/Projects/wordpress&lt;/code&gt; in your terminal and enter the below command if you want to stop the running containers, but want to save all data associated with your site.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose down
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to &lt;code&gt;~/Projects/wordpress&lt;/code&gt; in your terminal and enter the below command if you want to stop the running containers and remove all data associated with your site.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose down &lt;span class="nt"&gt;--volumes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are a few ways you can get WordPress running locally, however I have found using Docker makes it easier. I can count on the fact that all the right dependencies will be used and I don't have to install specific applications on my machine. If you are interested in learning more about what tools and application I use for development check out my &lt;a href="https://dev.to/roccosangellino/setting-up-a-web-development-machine-13km"&gt;Setting up a web development machine&lt;/a&gt; article.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>docker</category>
    </item>
    <item>
      <title>Button or Link - Which to choose?</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Thu, 14 Jan 2021 20:38:18 +0000</pubDate>
      <link>https://dev.to/roccosangellino/button-or-link-which-to-choose-4aa3</link>
      <guid>https://dev.to/roccosangellino/button-or-link-which-to-choose-4aa3</guid>
      <description>&lt;p&gt;When building your website you often will be faced with a choice between using a &lt;code&gt;button&lt;/code&gt; or link (&lt;code&gt;a&lt;/code&gt;). In some cases a link is the clear choice when you need to link to another page, but what about in page features like ajax request, expand/collapse, and so on. Let's take a look at the uses for each and see the benefits of choosing one over the other.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Button&lt;/li&gt;
&lt;li&gt;Link&lt;/li&gt;
&lt;li&gt;Why is the distinction important?&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Button
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The HTML &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element represents a clickable button, used to submit forms or anywhere in a document for accessible, standard button functionality. By default, HTML buttons are presented in a style resembling the platform the user agent runs on, but you can change buttons’ appearance with CSS. - &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button"&gt;Mozilla&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words a &lt;code&gt;button&lt;/code&gt; is used for in page actions. Some example may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expand/Collapse&lt;/li&gt;
&lt;li&gt;Opening a modal&lt;/li&gt;
&lt;li&gt;Taking action to make an ajax request to update data&lt;/li&gt;
&lt;li&gt;Submitting a form
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Add Comic&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Link
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The HTML &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. Content within each &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; should indicate the link's destination. If the href attribute is present, pressing the enter key while focused on the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element will activate it. - &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a"&gt;Mozilla&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://google.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why is the distinction important?
&lt;/h2&gt;

&lt;p&gt;Screen readers and keyboard navigation have slightly different handling of buttons and links. If we deviate from those rules and guidelines we can be causing frustrations for our users that rely on those tools. Below are some examples of the differences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When a screen reader loads your site it will count the number of links and lets the user know.&lt;/li&gt;
&lt;li&gt;When you focus to a link a screen reader will read the link content and then say "link".&lt;/li&gt;
&lt;li&gt;Links are activated on enter.&lt;/li&gt;
&lt;li&gt;Buttons can be activated with space or enter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users who are familiar with screen readers, keyboard navigation and other tools are relying on us to follow a set of rules and guidelines so they are able to navigate our site as a visual user or mouse user would.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt; Let's say you use a link instead of a button the user might be inclined to the spacebar to perform the action, but it won't work. This could cause frustration and could lead to them leaving your site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;It's important to use semantic markup so we can provide the best possible experience for all users. If for some reason you can't use a &lt;code&gt;button&lt;/code&gt; you can use the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles"&gt;aria-role&lt;/a&gt; of button so screen readers with treat the element as a button. However, it will be up you to implement the functionality to ensure the behavior acts as a button.&lt;/p&gt;

&lt;p&gt;Thanks for reading. Be on the lookout for more accessibility tips.&lt;/p&gt;

</description>
      <category>html</category>
      <category>a11y</category>
      <category>javascript</category>
    </item>
    <item>
      <title>8 Tips to Improve Your Sites Accessibility</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Fri, 08 Jan 2021 18:36:58 +0000</pubDate>
      <link>https://dev.to/roccosangellino/8-tips-to-improve-your-sites-accessibility-kj0</link>
      <guid>https://dev.to/roccosangellino/8-tips-to-improve-your-sites-accessibility-kj0</guid>
      <description>&lt;p&gt;There are many different techniques and rules to building an accessible website and it might feel overwhelming. However, we want to make sure we build it in such a way that is usable for everyone. Below are a few tips that you can start implementing today that can improve your sites accessibility:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Heading Structure&lt;/li&gt;
&lt;li&gt;Alt Attribute&lt;/li&gt;
&lt;li&gt;Descriptive text for links&lt;/li&gt;
&lt;li&gt;Form Labels&lt;/li&gt;
&lt;li&gt;Table Captions&lt;/li&gt;
&lt;li&gt;Scope Attribute&lt;/li&gt;
&lt;li&gt;Visible Focus&lt;/li&gt;
&lt;li&gt;Tabindex&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. &lt;strong&gt;Heading Structure&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It is important to provide the correct heading structure as your headings outline the content of your site. Assertive technologies, browser plugins, and other tools can provide ways for users to navigate your site based on headers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Heading 1&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Heading 2&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Heading 3&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;Heading 4&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;Heading 5&lt;span class="nt"&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;Heading 6&lt;span class="nt"&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. &lt;strong&gt;Alt Attribute&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When using images on your site you should always provide the &lt;code&gt;alt&lt;/code&gt; attribute. The &lt;code&gt;alt&lt;/code&gt; attribute is used to the describe the image. This allows assertive technologies to read the description to the user. You might be asking yourself "What if I want to use an image for icons or presentational purposes?". In this case you should still add the &lt;code&gt;alt&lt;/code&gt; attribute but leave the value empty. This lets assertive technologies know it's safe to ignore the image.&lt;/p&gt;

&lt;p&gt;For example, let's say we want to display the below image on our site and we want assertive technologies to be able to read the description to the user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hrq1X1Ae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/akjtlcda5y1irld7v8gv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hrq1X1Ae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/akjtlcda5y1irld7v8gv.png" alt="1968-chevrolet-camaro-convertible-57-1500x550" width="400" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The HTML for the above image would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"1968-chevrolet-camaro-convertible.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"1968 Red Chevrolet Camaro Convertible"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. &lt;strong&gt;Descriptive text for links&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Using descriptive text for your links allows users to distinguish the different links on the site and helps them determine if they want to follow the link. This is vital for users using a screen reader. They can navigate your site using the tab key and rely on the content to help them understand what they are viewing. The descriptive text help determine if they should proceed to clicking the link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't do&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click here&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Do&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;1968 Chevrolet Camaro Convertible&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You do not need to include the word "link" in your text because the screen reader will announce to the user they are on a link.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Form Labels&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Form labels provide context as to what the form input is requiring. There are two ways to associate a label with form element: explicitly or implicitly (see below for examples). The form label also provides a larger clickable area to access the form element. When you click the form label it will automatically set focus to the associated element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explicitly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explicitly means the &lt;code&gt;for&lt;/code&gt; attribute on the &lt;code&gt;label&lt;/code&gt; matches the the &lt;code&gt;id&lt;/code&gt; attribute of the form element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"first-name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;First Name&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"first-name"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Rocco"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Implicitly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implicitly means you wrap the form element within the label element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;
    First Name
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"first-name"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Rocco"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I recommend using the explicit approach as according to  &lt;a href="https://www.w3.org/WAI/tutorials/forms/labels/"&gt;WAI&lt;/a&gt;. It generally has better screen reader support.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;strong&gt;Table Captions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;caption&lt;/code&gt; acts as a title of a table. It's useful for a user using a screen reader. If the user is in table mode they primarily use the caption to identify tables. This allows for better navigation and data association. I recommend adding captions to all tables to ensure the best possible experience for all users. If you don't want the caption displayed you can use CSS to display the element off-screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;Company Information&lt;span class="nt"&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Name&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Symbol&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Price&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Microsoft Corporation&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;MSFT&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;$218.29&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. &lt;strong&gt;Scope Attribute&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;scope&lt;/code&gt; attribute is used by screen readers to associate data cells with corresponding header cells. Screen readers will do their best to guess which to use. The default value of &lt;code&gt;scope&lt;/code&gt; is &lt;code&gt;col&lt;/code&gt;. I recommend being explicit to avoid guessing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;User Information&lt;span class="nt"&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Name&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"col"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Age&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;scope=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Rocco Sangellino&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;36&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. &lt;strong&gt;Visible Focus&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Visible focus helps a keyboard user know which actionable element has focus. The browser has a default style but these tend be removed in css resets or if styles are undesirable. You are able to add your own style to match your sites design. The benefit of providing a focus style is it provides aid to a keyboard user operating your site. The important piece is to at lease add some type of style to a focus state to ensure the best possible experience for all users.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Submit&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* default Chrome style */&lt;/span&gt;
&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;-webkit-focus-ring-color&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Custom CSS */&lt;/span&gt;
&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:focus&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. &lt;strong&gt;Tabindex&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Tabindex is used to manage keyboard focus. There are three types of uses: &lt;code&gt;tabindex="-1"&lt;/code&gt;, &lt;code&gt;tabindex="0"&lt;/code&gt;, &lt;code&gt;tabindex="1"&lt;/code&gt; (or any number greater than 1). Lets break down what each of these mean below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tabindex="-1"&lt;/code&gt; - removes the element from the default navigation flow. Meaning you will not be able to tab to the element using the keyboard, but you will be able to programmatically set focus. Most of the time these are used on non-interactive elements such as: div, span, or paragraph. This can be useful when a modal is opened and you want to set focus to it or if you are in a form and want to set focus to an error message.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"modal-dialog"&lt;/span&gt; &lt;span class="na"&gt;tabindex=&lt;/span&gt;&lt;span class="s"&gt;"-1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"sr-only"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Start of modal&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"modal-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Header&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"modal-body"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Modal Content&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"sr-only"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;End of modal&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.modal-dialog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;focus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tabindex="0"&lt;/code&gt; - allows elements to receive keyboard focus without affecting the normal navigation flow. This is usually used on elements besides links and form elements as those already have keyboard navigation. This can be used if you are creating a custom element that is not normally focusable.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;tabindex=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;I am now focusable via the keyboard.&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: If you use &lt;code&gt;role="button"&lt;/code&gt; you will need to add &lt;code&gt;enter&lt;/code&gt; and &lt;code&gt;spacebar&lt;/code&gt; functionality as the div needs to fully act as a button.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tabindex="1"&lt;/code&gt; - manually setting the tabindex to something other than &lt;code&gt;-1&lt;/code&gt; or '0' should be avoided. This will affected the normal navigation flow and could be confusing to the user and cause undesirable results. All elements that are tabbable will have a default tabindex based on their position in the DOM. Looking at the example below notice how no tabindex is set. The browser will first focus to the &lt;code&gt;button&lt;/code&gt; then to &lt;code&gt;a&lt;/code&gt; and finally to the last &lt;code&gt;button&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Will be focused first&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Will be focused second&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Will be focused third&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I provided a few tips that can be used to update your current site or if you are starting a new one. I encourage you to take the time and read up on web accessibility so all users can enjoy your site. Below are a few links to help you get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;Web Content Accessibility Guidelines (WCAG)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/"&gt;WebAIM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/Overview.html#contents"&gt;Understanding WCAG 2.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/TR/wai-aria/"&gt;Accessible Rich Internet Applications (WAI-ARIA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>a11y</category>
    </item>
    <item>
      <title>Setting up a web development machine</title>
      <dc:creator>Rocco Sangellino</dc:creator>
      <pubDate>Fri, 01 Jan 2021 19:48:39 +0000</pubDate>
      <link>https://dev.to/roccosangellino/setting-up-a-web-development-machine-13km</link>
      <guid>https://dev.to/roccosangellino/setting-up-a-web-development-machine-13km</guid>
      <description>&lt;p&gt;When beginning to code, sometimes it can feel overwhelming to create your ideal setup. When starting your web development journey in HTML, CSS, and JavaScript, it is helpful to have a starting point for getting set up. With so many different languages, programs, and free resources, you often find yourself wondering where is best to start. I've created a list of applications to help you get started in your journey to becoming a programmer. There are many ways to get yourself going, and I encourage you to do your own research to see what works best for you. Here are some great applications to help you get setup and on your way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Homebrew (available on Mac)&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Browser&lt;/li&gt;
&lt;li&gt;Text Editor&lt;/li&gt;
&lt;li&gt;Terminal&lt;/li&gt;
&lt;li&gt;NodeJS&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;HTTP and REST Client&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Homebrew (available on Mac)
&lt;/h2&gt;

&lt;p&gt;Homebrew is a package manager (see definition below) that allows you to install applications (packages) via the command line. One of the benefits of using a package manager is it allows you to automate your system install. This is helpful when you upgrade to a new computer and aren't restoring from a backup. What might take you hours to setup your system could take minutes with a startup script using a package manager (be on the lookout for a future article breaking down what a startup script would look like). If you are familiar with Linux this is similar to the &lt;code&gt;apt&lt;/code&gt; on Debian or &lt;code&gt;pacman&lt;/code&gt; on Arch.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A package manager keeps track of what software is installed on your computer, and allows you to easily install new software, upgrade software to newer versions, or remove software that you previously installed. As the name suggests, package managers deal with packages: collections of files that are bundled together and can be installed and removed as a group. - debian.org&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: You don't necessarily need this to be a developer or to get started but it could become beneficial and I recommend installing it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Homebrew
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;I recommend following the instructions in the above link. However, for a quick reference, the below command should install homebrew. Open a terminal and paste the following command - &lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"&lt;/code&gt;. After running the previous command you may be prompted for further instructions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Git
&lt;/h2&gt;

&lt;p&gt;Git is a version-control system for tracking changes. Version control is the practice of tracking and managing file changes to your code or assets. Think about it as saving changes to a file in word or google docs, but keeping a record-of who changed the file, when it was changed, and what changes occurred at each save point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Version control is an important concept to understand. You will encounter this on your journey and I recommend installing. &lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Git
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"&gt;git&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;There are a couple different ways to install &lt;code&gt;git&lt;/code&gt; depending on your OS. The above link will have a breakdown of Link, Mac, or Windows. Here is a quick reference:&lt;/li&gt;
&lt;li&gt;Mac&lt;/li&gt;
&lt;li&gt;Open your terminal and paste &lt;code&gt;git --version&lt;/code&gt;. If &lt;code&gt;git&lt;/code&gt; isn't installed, it will prompt you with instructions to install.&lt;/li&gt;
&lt;li&gt;Alternatively if you have &lt;code&gt;homebrew&lt;/code&gt; installed you can paste the following command in a terminal &lt;code&gt;brew install git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Linux (debian based)&lt;/li&gt;
&lt;li&gt;First you need to update your packages and then install &lt;code&gt;git&lt;/code&gt;. We can do this in one line &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/download/win"&gt;Git for windows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Browser
&lt;/h2&gt;

&lt;p&gt;My browser of choice for development is Google Chrome. I use chrome because I prefer the dev tools over firefox. In my opinion chrome's dev tools are easy to use, has a variety of extensions, and I like the built in feature that allows you to simulate mobile screen sizes.  However, firefox is great and I use multiple browsers while developing to test my code and ensure it is working in all browsers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing a browser
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.google.com/chrome/"&gt;Google Chrome&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mozilla.org/en-US/firefox/new/?utm_medium=referral&amp;amp;utm_source=support.mozilla.org"&gt;firefox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Safari preinstalled on mac&lt;/li&gt;
&lt;li&gt;Edge preinstalled on windows&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Text Editor
&lt;/h2&gt;

&lt;p&gt;There are many editors you can choose from. It will come down to personal preference in which one you choose. My editor of choice is VS Code. It integrates well with many programming languages and has a plethora of extensions to choose from. Below is the link to VS Code along with some alternatives you may like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: You can use any text editor to develop. Even a plain editor like notepad. I recommend installing one of the below editors as it will provide additional tooling that will help you develop. Such as syntax highlight, code formatting, debugging tools, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing a text editor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com/"&gt;VS Code&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt; Extensions I use &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sublimetext.com/"&gt;Sublime Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.vim.org/"&gt;Vim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VS Code Extensions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: You don't necessarily need any of the below extensions to develop. For each of the below extensions I explain why I use them and what they are used for. I encourage you to try them and see which ones you prefer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv"&gt;DotENV&lt;/a&gt; - This is a nice extension to have because it adds syntax highlighting for &lt;code&gt;.env&lt;/code&gt; files rather them appearing as plain text files.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;ESLint&lt;/a&gt; - I use this extension to integrated ESLint into VS Code. This provides immediate feedback into linting errors or warnings as you are coding. If you are unsure what ESLint is below is a description from the ESLint website:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"&gt;GitLens&lt;/a&gt; - I like this extension because it adds &lt;code&gt;git&lt;/code&gt; integration into VS Code. This allows me to quickly see when, why, and who changed a line of code without having to use the command line or another tool.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory"&gt;Git History&lt;/a&gt; - While GitLens provides me a quick look into changes, Git history allows me to view and search history right form VS Code. This saves me time without having to switch applications to view prior changes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense"&gt;Path Intellisense&lt;/a&gt; - I use this extension all the time when importing files. It provides intellisense and autocompletion for filenames.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"&gt;Prettier - Code formatter&lt;/a&gt; - I like Prettier because it allows you to define a set of rules for how you want your code formatted. For example, tabs vs paces, semi-colons vs no semi-colons, trailing commas, and a lot more rules. The reason this is valuable is because it keeps your code style consistent and it integrated with ESLint.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"&gt;Vetur&lt;/a&gt; - In my opinion this is a must for Vue.js developers. Vetur adds additional tooling like syntax highlighting, linting, snippets, intelliSense, and more to your vue files. You can also enable support for Typescript in your html templates. This is useful for immediate feedback if you have any errors or warnings within your template.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag"&gt;Auto Rename Tag&lt;/a&gt; - I find this extension useful because I don't have to worry if my HTML tags are mismatched. Once I start to change the HTML tag this extension will automatically rename the closing tag ensuring no mismatches take place.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=dzannotti.vscode-babel-coloring"&gt;Babel ES6/ES7&lt;/a&gt; - This extension is useful because it adds JS Babel es6/es7 syntax coloring to your JavaScript files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Terminal
&lt;/h2&gt;

&lt;p&gt;There are a variety of terminal emulators to choose from. I develop on a Mac and my go to terminal is &lt;code&gt;iTerm2&lt;/code&gt;. It offers a split pane feature that I like and use all the time. On windows I use &lt;code&gt;cmder&lt;/code&gt; and on linux I use &lt;code&gt;terminator&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Most computers come with a built in terminal and you don't need to install a different one. I recommend becoming familiar with one as you will be interacting with a terminal when developing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing a terminal
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.iterm2.com/"&gt;iterm2&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;I also make my terminal beautiful by using &lt;a href="https://ohmyz.sh/"&gt;"Oh My ZSH!"&lt;/a&gt; and &lt;a href="https://github.com/romkatv/powerlevel10k"&gt;powerlevel10k&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cmder.net/"&gt;cmder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;terminator - &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install terminator&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  NodeJS
&lt;/h2&gt;

&lt;p&gt;Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. If you are on Mac or Linux you may want to install &lt;a href="https://github.com/nvm-sh/nvm"&gt;nvm&lt;/a&gt; which is a version manager. This allows you to switch between node versions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: To be a web developer you don't need node.js. However, when you install node it comes with &lt;code&gt;npm&lt;/code&gt; (node package manager, definition below from npmjs). I recommend installing this as you will encounter node.js and npm when learning from tutorials or classes you may take.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;npm makes it easy for JavaScript developers to share and reuse code, and makes it easy to update the code that you’re sharing, so you can build amazing things.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installing node.js without nvm
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/"&gt;node.js&lt;/a&gt; - download the LTS version&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Installing node.js with nvm
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nvm-sh/nvm#installing-and-updating"&gt;node version manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Once you have installed &lt;code&gt;nvm&lt;/code&gt;, open a terminal and enter &lt;code&gt;nvm install node&lt;/code&gt; "node" is an alias for the latest version

&lt;ul&gt;
&lt;li&gt;If you want to install a specific version of &lt;code&gt;node&lt;/code&gt; you can replace &lt;code&gt;node&lt;/code&gt; with the version you prefer.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTTP and REST Client
&lt;/h2&gt;

&lt;p&gt;A HTTP and REST client allows you to send requests, view responses, and debug APIs. &lt;code&gt;Postman&lt;/code&gt; and &lt;code&gt;Insomnia&lt;/code&gt; both provide nice user interfaces to interact with APIs. I use these daily to ensure the APIs I am using are working as intended.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: You don't necessarily need to install a HTTP and Rest client to be a web developer. However, as I mentioned this will be beneficial to test APIs you are working with. I recommend installing at least one of the follow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing a HTTP and REST Client
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.postman.com/downloads/"&gt;Postman&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://insomnia.rest/download/"&gt;Insomnia&lt;/a&gt; - I download Insomnia Core.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Docker (Optional)
&lt;/h2&gt;

&lt;p&gt;The term &lt;code&gt;docker&lt;/code&gt; has become synonymous with the term &lt;code&gt;container&lt;/code&gt;. From the Docker website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simplest terms, a container allows you to run your application code segregated from other code on your system. This eliminates the need to install all of the necessary dependencies on your local machine. For example, I use docker to run WordPress without having to install all the dependencies WordPress requires such as apache, php, and MySQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Docker is not a requirement and not needed to be a web developer. I included docker because it is something I use daily and is popular within the dev community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing docker
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/compose/install/"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are a lot more tools out there that you will run into. I hope my list gets you started on your development journey. I encourage you to try them out and see what's right for you. I personally use each of these daily and have enjoyed working with them.&lt;/p&gt;

&lt;p&gt;Check back soon for more posts where I outline how to break down a project, how to use project management tools, and keeping yourself on task and on target.&lt;/p&gt;

&lt;p&gt;Most importantly, I would love to hear feedback on what you found helpful and if there are resources that you think would be helpful and/or could be added. You can leave comments down below or find me on &lt;a href="https://twitter.com/RoccoSangellino"&gt;twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>html</category>
      <category>javascript</category>
      <category>css</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
