<?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: Ethan Huang</title>
    <description>The latest articles on DEV Community by Ethan Huang (@ehuang).</description>
    <link>https://dev.to/ehuang</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%2F1119347%2Fdc95d84c-9f40-41a2-94c3-9ae222a2fdb9.jpg</url>
      <title>DEV Community: Ethan Huang</title>
      <link>https://dev.to/ehuang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ehuang"/>
    <language>en</language>
    <item>
      <title>TIL # 6 Flexbox</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Thu, 10 Aug 2023 03:05:37 +0000</pubDate>
      <link>https://dev.to/ehuang/til-6-flexbox-305m</link>
      <guid>https://dev.to/ehuang/til-6-flexbox-305m</guid>
      <description>&lt;p&gt;Flexbox is another way to position the elements on your homepage. I find it a bit easier to understand than the box model. &lt;a href="https://flexboxfroggy.com/"&gt;Flexbox Froggy&lt;/a&gt; is a webpage minigame to help understand the different properties that are available in Flexbox.&lt;/p&gt;

&lt;p&gt;To start, we need to understand that flex containers and flex items are 2 separate things. Flex containers will contain flex items, so the direct child elements of flex containers are considered as flex items. To specify a flex container, you must add a CSS declaration of &lt;code&gt;display: flex&lt;/code&gt; or &lt;code&gt;display: inline-flex&lt;/code&gt;. There are several properties and their values that we will discuss too, these will include &lt;code&gt;justify-content&lt;/code&gt;, &lt;code&gt;align-items&lt;/code&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex-grow"&gt;&lt;code&gt;flex-grow&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex-shrink"&gt;&lt;code&gt;flex-shrink&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex-basis"&gt;&lt;code&gt;flex-basis&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex"&gt;&lt;code&gt;flex&lt;/code&gt;&lt;/a&gt;, &lt;code&gt;flex-wrap&lt;/code&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/align-content"&gt;&lt;code&gt;align-content&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex-direction"&gt;&lt;code&gt;flex-direction&lt;/code&gt;&lt;/a&gt;, and &lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/flex-flow"&gt;&lt;code&gt;flex-flow&lt;/code&gt;&lt;/a&gt;. If any of the topics are linked, it means it was challenging to describe it in a post To quickly describe what &lt;code&gt;display: flex&lt;/code&gt; does, lets imagine 3 squares vertically stacked with the &lt;code&gt;div&lt;/code&gt; class. If you added &lt;code&gt;display: flex&lt;/code&gt; in CSS, it would cause those squares to line up horizontally side by side. &lt;code&gt;display: inline-flex&lt;/code&gt; works pretty similarly, but will leave inline elements as they are instead of turning them into blocks.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;justify-content&lt;/code&gt; consists of 5 values, &lt;code&gt;flex-start&lt;/code&gt;, &lt;code&gt;flex-end&lt;/code&gt;, &lt;code&gt;center&lt;/code&gt;, &lt;code&gt;space-around&lt;/code&gt;, and &lt;code&gt;space-between&lt;/code&gt;. Let's imagine 3 boxes, side by side, flushed to the left as their default position. &lt;code&gt;flex-start&lt;/code&gt; will normally position all 3 boxes flushed to the left, or the start of the line. &lt;code&gt;flex-end&lt;/code&gt; however will take the 3 boxes and flush them to the right, or the end of the line. &lt;code&gt;center&lt;/code&gt;, accordingly named, will take the 3 boxes and put them side by side in the center of the page. &lt;code&gt;space-around&lt;/code&gt; will leave a gap of space between the 3 boxes, as well as 2 gaps at the start and end of a line (space 1 - box 1 - space 2 - box 2 - space 3 - box 3 - space  4). &lt;code&gt;space-between&lt;/code&gt; will only create 2 larger spaces that separate box 1 from box 2, and box 2 from box 3 (box 1 - space 1 - box 2 - space 2 - box 3), so that box 1 and box 3 are flushed to the start and end, and box 3 assumes the center spot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codecademy.com/courses/learn-css-flexbox-and-grid/lessons/learn-flexbox/exercises/align-items"&gt;&lt;code&gt;align-items&lt;/code&gt;&lt;/a&gt; deals with items inside the container, and also has 5 values, although I'm not as confident at explaining 2 of them so I will leave a link to visually understand it all . This time we will discuss we are reusing &lt;code&gt;flex-start&lt;/code&gt;, &lt;code&gt;flex-end&lt;/code&gt;, and &lt;code&gt;center&lt;/code&gt;, however we are also now including &lt;code&gt;baseline&lt;/code&gt; and &lt;code&gt;stretch&lt;/code&gt; (both of which I have a slightly harder time explaining). If we take our 3 identical squares before, placing them side by side and in the center of a container, &lt;code&gt;flex-start&lt;/code&gt; will place the items flushed at the top of the container and remaining in the middle. &lt;code&gt;flex-end&lt;/code&gt; will place the items all at the bottom of the container. &lt;code&gt;center&lt;/code&gt; is straightforward once again, and would place the items floating in the middle of the container.&lt;/p&gt;

&lt;p&gt;Very brief, but the &lt;code&gt;flex&lt;/code&gt; property includes all of &lt;code&gt;flex-grow&lt;/code&gt;, &lt;code&gt;flex-shrink&lt;/code&gt;, and &lt;code&gt;flex-basis&lt;/code&gt; all at the same time, the values just need to be placed in that respective order. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;flex-wrap&lt;/code&gt; has 3 values, &lt;code&gt;wrap&lt;/code&gt;, &lt;code&gt;wrap-reverse&lt;/code&gt;, and &lt;code&gt;nowrap&lt;/code&gt;. Let's imagine 5 squares numbered 1-5 (in order left to right) aligned in a row. As a page compresses sideways, the squares will squeeze together and reorient themselves. In &lt;code&gt;wrap&lt;/code&gt;, square 5 will drop down a row, followed by square 4 on its left. In &lt;code&gt;wrap-reverse&lt;/code&gt;, the entire row except for square 5 drops down a row, then square 4 joins it on square 5's left. In &lt;code&gt;nowrap&lt;/code&gt; however, the squares will remain in place and won't move despite how smushed the webpage is. &lt;/p&gt;

&lt;p&gt;Unfortunately I couldn't explain everything, but sometimes seeing how it works on your own is better than simply reading an explanation. I hope that this post could be of some use!&lt;/p&gt;

</description>
      <category>css</category>
      <category>flexbox</category>
    </item>
    <item>
      <title>TIL #5 The Box Model Lite</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Wed, 09 Aug 2023 20:05:41 +0000</pubDate>
      <link>https://dev.to/ehuang/til-5-the-box-model-lite-n24</link>
      <guid>https://dev.to/ehuang/til-5-the-box-model-lite-n24</guid>
      <description>&lt;p&gt;The box model is quite hard for me to explain, but I have embedded several links to resources that have more visual guides to explain how they work! Here are some of the basics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BOX MODEL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The box model is a way to understand how spacing works for the elements on an HTML page. These include the dimensions (width and height), borders, paddings, and margins of an element's box. Without a visual guide, think of a small rectangle that is encompassed by 3 slightly larger rectangles of increasing sizes. The smallest, innermost rectangle is the content, then as you go up the rectangle sizes, the spaces between are the padding, border, then margin (largest and outermost) rectangle. It is important to play around with the dimensions so that the content of your page doesn't get too crowded as you keep adding more stuff into it. &lt;/p&gt;

&lt;p&gt;As it is called the box model, we use CSS to make changes to how the boxes look. You can add a border color as well as radius (thickness) to have it pop out more. Adding padding can space out the border further away from your content in order to not crowd it, you can do this by adding &lt;code&gt;px&lt;/code&gt; to either all or any direction. If you decide to write it in a shorthand method but will several directions, you can list out all the paddings in the direction of top, right, bottom, left like: &lt;code&gt;padding: 6px 11px 4px 9px;&lt;/code&gt;. There is even shorthand for 3 (top, left &amp;amp; right, bottom) or just 2 (top &amp;amp; bottom, left &amp;amp; right) directions as well. Margins function similarly to padding, except it applies to the space outside the border, and separates content from each other. Margins can also be applied with &lt;code&gt;auto&lt;/code&gt; to make the left and right margins become centered.&lt;/p&gt;

&lt;p&gt;Something to note about the box model is also setting a minimum and maximum width and height. This is to ensure that reading the content on a page doesn't appear too wonky if you're looking at the same website on a phone or a laptop. Another property you can also add is overflow, and includes &lt;code&gt;hidden&lt;/code&gt;, &lt;code&gt;scroll&lt;/code&gt;, or &lt;code&gt;visible&lt;/code&gt; that affect how content that leaks of their respective box can be viewed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POSITIONING&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the previous section we talked about the box model, but now we'll talk about how these boxes can be ordered and the positions they can assume. First off, all boxes start in a static position, which is the default position. There are also &lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/position-relative"&gt;relative&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/position-absolute"&gt;absolute&lt;/a&gt;, &lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/position-fixed"&gt;fixed&lt;/a&gt;, and &lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/position-sticky"&gt;sticky&lt;/a&gt; positions as well, which can be played around with for different results. Admittedly, these are a bit hard to explain by text without any visuals, so I will hyperlink each position to its corresponding Codecademy link above. &lt;/p&gt;

&lt;p&gt;To add a bit more to the relative position, you can also add a z-index as well. If that is unfamiliar term, let's think about a cheeseburger. It has a bottom bun (z-index = 0), burger (z-index = 1), cheese (z-index = 2), top bun (z-index = 3). Now look at the burger from a bird's eye view, bottom bun on the table, you'll only see the top bun right? Z-index's can be thought of as layers, and having a higher index gives it more visibility than a box or object that has a lower z-index.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/float"&gt;Float&lt;/a&gt; is a property to wrap text around an image, and essentially tries to force whatever it is applied to in the direction it is given. &lt;a href="https://www.codecademy.com/courses/learn-css-box-model-and-layout/lessons/css-display-positioning/exercises/clear"&gt;Clear&lt;/a&gt; is a property that stops elements from 'bumping' into one another. Again, this needs more of a visual guide, so I will link it once again to Codecademy. &lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>flexbox</category>
    </item>
    <item>
      <title>TIL #4 CSS</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Tue, 08 Aug 2023 06:02:14 +0000</pubDate>
      <link>https://dev.to/ehuang/til-4-css-511i</link>
      <guid>https://dev.to/ehuang/til-4-css-511i</guid>
      <description>&lt;p&gt;CSS- cascading style sheets; this is used to style HTML, the reason why it is called cascading is because it applies properties going down line by line, so if there are overlaps of certain affected elements than the lowest property will be applied&lt;/p&gt;

&lt;p&gt;Just going to talk about CSS in this post, the box model and flexbox that are coming up next will be separate posts!&lt;/p&gt;

&lt;p&gt;SETUP AND SYNTAX&lt;/p&gt;

&lt;p&gt;CSS is a separate file from and HTML one, and it is more commonly practiced to put all the styling into a CSS file. In HTML, you will have to &lt;code&gt;link&lt;/code&gt; it to a CSS file like so: &lt;code&gt;&amp;lt;link href="./style.css" rel="stylesheet"&amp;gt;&lt;/code&gt; this is normally put in the &lt;code&gt;head&lt;/code&gt;. "style.css" is the name of the CSS file, you can name it whatever you want but style.css seems to be some sort of unspoken default, so I use that too. &lt;code&gt;href&lt;/code&gt; refers to the path of the CSS file (./ means the files is in a relative path, because normally the HTML and CSS is in the same folder), while &lt;code&gt;rel&lt;/code&gt; refers to the relationship of the HTML and CSS file, in this case it is the stylesheet.&lt;/p&gt;

&lt;p&gt;There are 5 different features that a CSS ruleset, or a single block of CSS, shares with the inline CSS that you can do in HTML. There are selectors, the declaration block, the declaration, the property, and the value. This &lt;a href="https://www.codecademy.com/courses/learn-css-introduction/lessons/learn-css-setup-and-syntax/exercises/css-anatomy"&gt;Codecademy page shows the CSS ruleset to CSS inline style&lt;/a&gt; conversion of CSS to HTML. Let's break down a CSS ruleset.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
   color: yellow;
}
&amp;lt;!--The selector targets an element, so that's the h1 --&amp;gt;
&amp;lt;!--The declaration block is all the code between the {} brackets --&amp;gt;
&amp;lt;!--The property shows how the element will be changed,
in this case it is the color --&amp;gt;
&amp;lt;!--The value shows how the property will change,
in this it is yellow --&amp;gt;
&amp;lt;!--The declaration consists of the property &amp;amp; value pair
in this case it is color:yellow; --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you really want to inline style CSS inside HTML, you just need to add &lt;code&gt;style='declaration'&lt;/code&gt; inside an opening tag. You can put multiple declarations if needed. I really don't see the practically when making a new CSS page is much cleaner, the only thing it seems to be meant for is if you're working with a very small HTML page or just want to play around with how something looks (please comment if there are other practical uses for inline styling!). That would look something like &lt;code&gt;&amp;lt;h1 style='color:yellow;'&amp;gt;Why inline styling?&amp;lt;/h1&amp;gt;&lt;/code&gt;. This is inconvenient because you need to manually input inline CSS into every individual element if you want to target multiple elements. You can however play around this by putting &lt;code&gt;style&lt;/code&gt; in the &lt;code&gt;head&lt;/code&gt;, and type it out like CSS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;head&amp;gt;
  &amp;lt;style&amp;gt;
    h1 {
      color: yellow;
      font-size: 20px;
      }
  &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SELECTORS&lt;/p&gt;

&lt;p&gt;You can declare a certain type of element to be styled by starting the line of CSS with the element type, followed by brackets, and included inside it would be the declaration for example &lt;code&gt;p{ color: maroon }&lt;/code&gt;. If you use an &lt;code&gt;*&lt;/code&gt; instead for the selector, this is considered universal and will be applied to everything else. Selectors can also be done going by classes and id's, for these you would have to write them by &lt;code&gt;.class&lt;/code&gt; and &lt;code&gt;#id&lt;/code&gt;, with a period or hashtag symbol respectively. Another thing to note is that you can add multiple selectors in a row to add more specificity, and the more specific you are it can override other overarching declarations that are less specific. You can also separate multiple elements so that they can share a few similar declarations, but still allow for additional separate declarations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p {
  color: blue;
  &amp;lt;!--Normal targeting one element --&amp;gt;
}

.main p {
  color: red;
  &amp;lt;!--Specified targeting of a p under a main class --&amp;gt;
}

.main, p {
  color: yellow;
  &amp;lt;!--Targeting both main and p--&amp;gt;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ATTRIBUTE&lt;/p&gt;

&lt;p&gt;Attributes are how you will make edits to the HTML elements. These include color, width, height, font-style, Flexbox, and so much more. Something you can add to the end of a declaration (but still enclosed by the &lt;code&gt;;&lt;/code&gt; is &lt;code&gt;!important&lt;/code&gt;, which will override any style regardless of specificity. A couple of the more complicated attributes to understand was one that I had previously mentioned, Flexbox, as well as the box model, which I will cover in another TIL!&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>TIL #3 HTML</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Wed, 19 Jul 2023 02:50:15 +0000</pubDate>
      <link>https://dev.to/ehuang/til-3-html-2m49</link>
      <guid>https://dev.to/ehuang/til-3-html-2m49</guid>
      <description>&lt;p&gt;Some notes I wanted to leave while reviewing HTML. The CSS notes are coming after! Big shoutout to the team for teaching me about markdown for the blog, it really helped with cleaning up how the blog post looks. If you also need the shortcuts, while editing click on the 'Commonly used syntax' option under the 'Editor Basics' to the right of where you are typing the blog post.&lt;/p&gt;

&lt;p&gt;HTML = hypertext markup language; structure and presentation of raw text, includes links to access other text&lt;/p&gt;

&lt;p&gt;BASIC STRUCTURE&lt;/p&gt;

&lt;p&gt;We want to start our HTML page with &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt; as the first line of code. In short, this tells the browser that the file is going to be in HTML. Don't forget to save this as .html as well. Just because it has been declared as an HTML document, we still need to include the HTML open and closing tags to embody the rest of the code. &lt;/p&gt;

&lt;p&gt;Speaking of tags and the content it surrounds, altogether it would be called an HTML element (referring to below)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p&amp;gt;Hello World!&amp;lt;/p&amp;gt; 
&amp;lt;!-- &amp;lt;p&amp;gt; and &amp;lt;/p&amp;gt; are the opening and closing tags respectively, Hello World! is the content --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic structure of an HTML file will consist of the &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;. The &lt;code&gt;head&lt;/code&gt; is where metadata (fancy word for info that describes and explains data) is contained, the &lt;code&gt;title&lt;/code&gt; is an element that would fit here (this will be seen as the name of the tab. The &lt;code&gt;body&lt;/code&gt; is where most of your HTML content will belong, for example the text, pictures, or buttons. A bare-bones basic HTML document will follow a similar structure like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
 &amp;lt;head&amp;gt;
  &amp;lt;body&amp;gt;
   &amp;lt;div&amp;gt;
   &amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
 &amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ELEMENTS AND TAGS&lt;/p&gt;

&lt;p&gt;HTML is classified with parent and child elements. Elements that are contained within another are considered the children , while the one that encompasses it is the parent. When CSS is later applied to the HTML, the children may sometimes be affected by the parent's styling. Usually, the parent will be less indented compared to the child element, so having clean looking code is important.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt; &amp;lt;!-- parent element --&amp;gt;
 &amp;lt;p&amp;gt;Hello World!&amp;lt;/p&amp;gt; &amp;lt;!-- child element --&amp;gt;
&amp;lt;/body&amp;gt; &amp;lt;!-- parent element --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Headings are defined by &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;, ... &lt;code&gt;h6&lt;/code&gt;, with the size decreasing as you get closer to 6. Important titles and headings should have lower h#, like &lt;code&gt;h1&lt;/code&gt; or &lt;code&gt;h2&lt;/code&gt;. Paragraphs or &lt;code&gt;p&lt;/code&gt; tags normally act as the child element under headings for the main content. There are other ways to space content besides paragraphs, line breaks or &lt;code&gt;br&lt;/code&gt; tags will act similarly. If one &lt;code&gt;br&lt;/code&gt; is used, the next sentence will continue on the next line, while if 2 &lt;code&gt;br&lt;/code&gt; are used, there will be a gap between the sentences. &lt;code&gt;hr&lt;/code&gt; is another kind of break, that will actually create a physical horizontal line within the text. It is nice that the &lt;code&gt;br&lt;/code&gt; and &lt;code&gt;hr&lt;/code&gt; tags do not need a closing tag, makes it slightly more convenient.&lt;/p&gt;

&lt;p&gt;One &lt;code&gt;br&lt;/code&gt; ex:&lt;br&gt;
Here is the first sentence.&lt;br&gt;
Here is the second sentence.&lt;/p&gt;

&lt;p&gt;Two &lt;code&gt;br&lt;/code&gt; ex:&lt;br&gt;
Here is the first sentence.&lt;/p&gt;

&lt;p&gt;Here is the second sentence.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;hr&lt;/code&gt; ex:&lt;br&gt;
Here is the first sentence.&lt;/p&gt;



&lt;p&gt;Here is the second sentence.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;div&lt;/code&gt; tags will separate elements into containers that will make it easier to style a specific group of elements. Referring to when I was writing about the parent and child elements, the &lt;code&gt;div&lt;/code&gt;s can stop a child from inheriting the parent's styling if you can target the div that the child is in.&lt;/p&gt;

&lt;p&gt;Attributes can be placed in an element's tag for additional styling, and to me the id and class attributes are super useful for targeting specific elements for CSS, like a more precise &lt;code&gt;div&lt;/code&gt; element. Styling can also be done within the tags such as using &lt;code&gt;em&lt;/code&gt; and &lt;code&gt;strong&lt;/code&gt;, for italics and bold (respectively). Unfortunately, we can't Ctrl+i or Ctrl+b as a shortcut.&lt;/p&gt;

&lt;p&gt;Lists are convenient ways to show separate items. There are 2 ways to do this, through &lt;code&gt;ul&lt;/code&gt; tags or &lt;code&gt;ol&lt;/code&gt; tags. &lt;code&gt;ul&lt;/code&gt;, or unordered lists, will sort items out in bullet point fashion. &lt;code&gt;ol&lt;/code&gt;, or ordered lists, will sort items out in number fashion. The former is great for things like grocery lists or listing out many different places you might want to visit, while the latter is good for steps to cook a recipe or doing a top 10 ranking of something. Both list tags do share the &lt;code&gt;li&lt;/code&gt; child element which stands for list item, and all the list tags require both open and closing tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ex Costco grocery list
&amp;lt;ul&amp;gt;
  &amp;lt;li&amp;gt;Milk&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Eggs&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Chicken Nuggets&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Milk&lt;/li&gt;
&lt;li&gt;Eggs&lt;/li&gt;
&lt;li&gt;Chicken Nuggets
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ex Errands/Events by order for today
&amp;lt;ol&amp;gt;
  &amp;lt;li&amp;gt;Lunch with uncle&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Buy groceries&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Go to Nando's Peri Peri with friends&amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Lunch with uncle&lt;/li&gt;
&lt;li&gt;Buy groceries&lt;/li&gt;
&lt;li&gt;Go to Nando's Peri Peri with friends&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's nice to see pictures from time to time while reading a casual wall of text. It might seem a bit daunting at first, but all you really need to remember is having &lt;code&gt;&amp;lt;img src="image_link_here.jpg"/&amp;gt;&lt;/code&gt; and place the image link within the "". If I recall, it is nice to have the image downloaded because if you get the picture off the Internet, and the picture gets deleted, then nothing will show up. If the picture doesn't load, that's where you can add an &lt;code&gt;alt&lt;/code&gt; attribute to the picture, to at least provide some text of what the picture was supposed to show. The alt simply goes after the &lt;code&gt;src=""&lt;/code&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="image_link_here.jpg" alt="Great description of the image"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I haven't played around with adding videos on HTML, but it seems very similar to the images, but with extra steps. First thing to note is that &lt;code&gt;video&lt;/code&gt; needs to have both an open and closing tag, The second thing is that you need to set a width and height appropriately to view the video comfortably (this can be played around with, depending if the video should be seen horizontally or vertically). Third is that you need to include basic playback options with the &lt;code&gt;controls&lt;/code&gt; element. Finally if you want to add a similar &lt;code&gt;alt&lt;/code&gt; attribute, you simply type it after closing the opening &lt;code&gt;video&lt;/code&gt; tag. Looking over it overall, it seems pretty intuitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;video src="video_link_here.mp4" width="300" height="200" controls&amp;gt;
If you see this text, the video is not working &amp;lt;/video&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LINKS&lt;/p&gt;

&lt;p&gt;In HTML, you have the ability to hyperlink certain words or phrases that will take you to another page. This is great on sites like Wikipedia since it often refers to many other topics, so being able to quickly switch to learn about a new topic is useful. The way we add links to a word or phrase is by surrounding it with &lt;code&gt;a&lt;/code&gt; anchor tags, and including an &lt;code&gt;href&lt;/code&gt; attribute in the opening tag. Without the &lt;code&gt;href&lt;/code&gt;, the phrase will be clickable but it won't lead to anywhere. You can also make your link open up a new tab instead of replacing the current tab. To do this, you can add a &lt;code&gt;target&lt;/code&gt; attribute with a &lt;code&gt;_blank&lt;/code&gt; value. It would go after the &lt;code&gt;href&lt;/code&gt; link. Images can also be turned into links as well, we just need to add an &lt;code&gt;img&lt;/code&gt; element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href="https:/google.com"&amp;gt;This link will lead to Google &amp;lt;/a&amp;gt;
&amp;lt;!-- This will open Google in the same tab for the clickable link--&amp;gt;

&amp;lt;a href="https:/google.com" target="_blank"&amp;gt;This link will lead to Google &amp;lt;/a&amp;gt;
&amp;lt;!-- This will open Google in a new tab for the clickable link--&amp;gt;

&amp;lt;a href="https://e.wikipedia.org" target="_blank"&amp;gt;&amp;lt;img src="https://wikipedia_logo.jpg" alt="The Wikipedia Logo"/&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;!-- Note that for the picture, you need to place the `img src` within the `a`, and you can also add an alternate description if the picture doesn't load. --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In addition, another thing you can do is make links between external and internal pages. Let's start with external pages, and use a restaurant website as an example. Some different pages you would probably expect would be an about page, the menu, maybe a catering page, and a place to leave reviews, meaning you need to make a separate file for each different page. In HTML , you have to create these separate files all in a single folder (technically not true, but will make things so much easier) so that you can link them using a relative path &lt;code&gt;./&lt;/code&gt; (which means look for a file in the current folder).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ricobenes/
|--about.html
|--menu.html
|--catering.html
|--reviews.html
&amp;lt;!-- Great price and value, would definitely recommend the wings or breaded steak sandwich. Unfortunately not sponsored --&amp;gt;

&amp;lt;a href="./about.html"&amp;gt;About&amp;lt;/a&amp;gt;
&amp;lt;a href="./menu.html"&amp;gt;Menu&amp;lt;/a&amp;gt;
&amp;lt;a href="./catering.html"&amp;gt;Catering&amp;lt;/a&amp;gt;
&amp;lt;a href="./reviews.html"&amp;gt;Reviews&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For internal pages, let's look at using Wikipedia as another example. Say you are reading about an actor and want to skip to the list of movies they've acted in, normally near the top there should be a table of contents that lists several topics. By clicking it, you can jump to it directly without needing to scroll. To do this,  add an &lt;code&gt;id&lt;/code&gt; to certain target elements by placing the &lt;code&gt;id&lt;/code&gt; within an element's opening tag. This should then match the &lt;code&gt;#id&lt;/code&gt; of its respective element in the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p id="high"&amp;gt;I have the high ground&amp;lt;/p&amp;gt;
&amp;lt;h2 id="mid"&amp;gt;That movie is kinda mid&amp;lt;/h2&amp;gt;
&amp;lt;h1 id="low"&amp;gt;What a low blow&amp;lt;/h1&amp;gt;

&amp;lt;ul&amp;gt;
 &amp;lt;li&amp;gt;&amp;lt;a href="#high"&amp;gt;High&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
 &amp;lt;li&amp;gt;&amp;lt;a href="#mid"&amp;gt;Mid&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
 &amp;lt;li&amp;gt;&amp;lt;a href="#low"&amp;gt;Low&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OTHER THINGS&lt;/p&gt;

&lt;p&gt;There is a lot of importance in having clean code. While you can technically write code all in one line.. why would you when you can space it out evenly? The computer ignores the whitespace in between lines of code, so there is quite a bit of freedom in terms of the spacing. Indenting is also important because it can separate parent from child elements to keep better track. Indenting can either be done simply with the 'Tab' button or 2 spaces. Comments are also nice to include so you can make notes telling yourself what each part of your code means, or just to write a reminder to revisit something you are stuck on. This is done with &lt;code&gt;&amp;lt;!-- Insert Comment Here --&amp;gt;&lt;/code&gt; and it will be ignored by the browser.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
    </item>
    <item>
      <title>TIL #2 Codespace</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Tue, 18 Jul 2023 03:44:38 +0000</pubDate>
      <link>https://dev.to/ehuang/til-2-codespace-4dcn</link>
      <guid>https://dev.to/ehuang/til-2-codespace-4dcn</guid>
      <description>&lt;p&gt;TLDR: Codespace = VS Code in browser&lt;/p&gt;

&lt;p&gt;I think it's crazy that a tool as powerful as VS Code can be done all within a browser, without needing the extensive download times, extensions, and packages (unless that comes in the future). Codespace is a really neat tool, and going through this assignment helped me understand a new way to perform source control. I was so used to typing in the 'git push', 'git commit - m', etc. that I didn't realize that Codespace just needed 3 clicks instead. Well, maybe VS Code can do that too, but when I used it beforehand I didn't know it was that simple. Leaving myself a few notes here, in case I need the refresher especially with the new 'rackup' and 'rake grade' commands.&lt;/p&gt;

&lt;p&gt;Checking live preview and running tests in the terminal &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the + sign to add another Bash prompt&lt;/li&gt;
&lt;li&gt;Type "rackup" as the command (no "")&lt;/li&gt;
&lt;li&gt;Live preview complete! &lt;/li&gt;
&lt;li&gt;Click on ports &lt;/li&gt;
&lt;li&gt;Under 'Local Address' click the globe to open in new browser&lt;/li&gt;
&lt;li&gt;Git Source Control (left side squiggly icon)&lt;/li&gt;
&lt;li&gt;Add a comment describing changes&lt;/li&gt;
&lt;li&gt;Commit/ Sync Changes&lt;/li&gt;
&lt;li&gt;Go to normal Bash Prompt&lt;/li&gt;
&lt;li&gt;Type "rake grade"&lt;/li&gt;
&lt;li&gt;Open Rake Grade assignment and copy paste the assignment token (rinse and repeat until everything works, click the red tests to find issues!)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;P.S- I'm going to look into what exactly the Bash terminal is (and puma!)&lt;/p&gt;

</description>
      <category>beginners</category>
    </item>
    <item>
      <title>TIL #1 Posting to DPI Dev News</title>
      <dc:creator>Ethan Huang</dc:creator>
      <pubDate>Fri, 14 Jul 2023 19:28:01 +0000</pubDate>
      <link>https://dev.to/ehuang/til-1-posting-to-dpi-dev-news-n07</link>
      <guid>https://dev.to/ehuang/til-1-posting-to-dpi-dev-news-n07</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Add profile page link to the assignment and let the background worker (BW) collect the posts&lt;/li&gt;
&lt;li&gt;Open &lt;a href="https://dev.to/"&gt;https://dev.to/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;'Create Post' in the upper right hand corner&lt;/li&gt;
&lt;li&gt;Get typing!&lt;/li&gt;
&lt;li&gt;Publish &lt;/li&gt;
&lt;li&gt;Revisit post to make edits if needed&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It was a bit strange to not see a 'Create Post' button on &lt;a href="https://news.dpi.dev/"&gt;https://news.dpi.dev/&lt;/a&gt; , but at the very least I get it now! It's cool that there is a BW able to fetch the new posts. I am a bit curious, is the BW an actual person manually retrieving these posts, or is a bot that was written using code (and if the latter, what code was used to do it?)?&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
