<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bryan Smith on Medium]]></title>
        <description><![CDATA[Stories by Bryan Smith on Medium]]></description>
        <link>https://medium.com/@beeg_smith?source=rss-4b499ef02607------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zORD6zxSJLa-2bYWpZ8v1w.jpeg</url>
            <title>Stories by Bryan Smith on Medium</title>
            <link>https://medium.com/@beeg_smith?source=rss-4b499ef02607------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:25:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beeg_smith/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Guide to Color]]></title>
            <link>https://codeburst.io/guide-to-color-71fd92268113?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/71fd92268113</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[colors]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Tue, 12 Jun 2018 22:08:02 GMT</pubDate>
            <atom:updated>2018-06-13T13:59:48.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N3T-dRwlB8xrzfShdMn0rQ.jpeg" /></figure><p>Let’s talk about using color in our projects. We will cover everything from the different color types all the way to using different color schemes to make your designs come to life! Effectively using colors can make a world of difference in your project and take your design to the next level you are looking for. There won’t be much code in this article but don’t let that scare you! We are going to show you how you can utilize some tools, tricks and tweaks to take your usage of color from zero to hero.</p><h3>Why Color?</h3><p>Why would I write a post on color? Because this blog is here for more than just HTML, CSS and JavaScript. This blog is here to make you an overall better developer and that will more than likely include having to make some tough decisions like what colors to use. Choosing colors that go well together can make an enormous difference in the look and feel of your site. Take for example these two demos.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FOvVZWP%3Fheight%3D600%26slug-hash%3DOvVZWP%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FOvVZWP&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.OvVZWP.small.4d60da18-82c5-4945-9a0b-36ea5e697ca0.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/88aa4fef695e2a66977583f7a7f3270e/href">https://medium.com/media/88aa4fef695e2a66977583f7a7f3270e/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FaYOGyK%3Fheight%3D600%26slug-hash%3DaYOGyK%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FaYOGyK&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.aYOGyK.small.762cd9b2-309e-48b6-ad59-1921c275daae.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/89dee792f6ca0956173d229f5dc21e81/href">https://medium.com/media/89dee792f6ca0956173d229f5dc21e81/href</a></iframe><p>The first one is hard to look it. The blue text is not easy on the eyes and that yellow background leaves a lot to be desired. Below it, a simple gradient moves your eyes from left to right along with the text. A nice salmon-like color pops out against the dark background to emphasize the text. Now a lot of beauty is in the eye of the person looking at it. What I like and what you like can and will be different. And that is totally fine! There are some things though that just can’t be accepted and one of them is that harsh blue color.</p><h3>Types of Color</h3><p>I’m not talking about how you see magenta but I see purple. I’m talking about Hex, RGB(A) and HSL(A). The A’s are in parentheses because they are optional. These three different types of color are really only different by name. For example: #ff0000, rgb(255, 0, 0) and hsl(0, 100%, 50%) will all shake out to the exact same color (red). Then what the hell do all of these words mean? Great question. Let’s break them all down.</p><h3>Hex</h3><p>Hex is short for hexadecimal. Hex is the most common color form in web development because it used to be the only way HTML documents could read which color you were wanting to use. When using hex colors, they will start off with a # and then some combination of numbers and letters from A-F. There is some math to the why each digit or character represent a different color but math was never my scene and I only recently started liking Star Wars and it honestly isn’t crucial to know. One nicety of hex colors is that they can be turned into shorthand like we learned about with <a href="https://www.frontamentals.com/css-box-model">padding and margin</a>. If you have a hex color like this #ffffff (white), it can be shortened to #fff because the first three characters are the same as the last three. This #bb00cc (purple) can be this #B0C. Capitalization don’t make a difference but it is good practice to be consistent.</p><h3>RBG(A)</h3><p>RGB stands for Red, Blue and Green. The A is for the opacity of the color. If you are standing, you are going to want to sit down because I have some pretty big news. Different levels of red, blue and green are used to create different colors 🤯. I know, I know. Earth shattering. What does this mean for us? Those three colors in varying amounts make up every other color we know, unless you are one of those people that claim they can see more colors and if that is the case, good for you and go get some new hobbies.</p><p>The RBG patterns goes like this rgb(NUMBER-BETWEEN-0-255,NUMBER-BETWEEN-0-255,NUMBER-BETWEEN-0-255) or rgba(NUMBER-BETWEEN-0-255,NUMBER-BETWEEN-0-255,NUMBER-BETWEEN-0-255, PERCENTAGE-OF-OPACITY).</p><p>What does this mean for you as a developer? Not a whole lot. RGB used to be the preferred method for opaque background but hex colors can do just the same. Maybe you took a class in college that says RGB colors are superior and should always be used. If that makes you happy, go nuts.</p><h3>HSL(A)</h3><p>HSL is short for Hue, Saturation and Light. I really don’t want to go too deep into it because it is similar to RBG which is similar to Hex. It is honestly just another way to express what color you would like to show up on your page. The A also stands for the opacity of the color in this case.</p><p>The RBG patterns goes like this hsl(HUE-PERCENTAGE,SATURATION-PERCENTAGE,LIGHT-PERCENTAGE) or hsla(HUE-PERCENTAGE,SATURATION-PERCENTAGE,LIGHT-PERCENTAGE, PERCENTAGE-OF-OPACITY).</p><p>Aside from the previous three methods for describing a color, you also have the plain old color names like red, blue and yellow. Do be careful using these as your colors as some browsers will display them as slightly different shades so it is best to use one of the methods above.</p><p>I am excited for all you color snobs to let me know that there is in fact a difference in these color types and I am eagerly awaiting to ignore your comments from my yoga ball office chair.</p><h3>Picking Colors</h3><p>Remember how up above I said some people are just born with the ability to pick colors that go well? Yeah, I don’t like them too. For everyone else, there are some awesome tools out there that can help you in your search.</p><h3>Coolors.co</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*KVMlWFGIFvSG-ewh" /></figure><p>Oh man I am a big fan of <a href="https://www.coolors.co/">coolors.co</a>. Whenever I am starting a new project and I don’t have any sort of color scheme determined, I will start off here. With the simple tap of the space bar you can get a new color palette instantly. Like one (or two or three) of the colors? Go ahead and lock it in. Maybe you almost like that color but not quite? You can adjust it slightly and see alternate shades. Oh, it also has the hex code right at the bottom which honestly makes it so easy to quickly pull together colors.</p><p>Now this isn’t a cure all for picking colors that look great together. Occasionally I will get a palette that is truly horrible. If you aren’t able to get across the color picking finish line with the help of coolors, reach out to me and I will help you pick a few colors.</p><h3>color-hex.com</h3><p>This is another one of my go to sites. Maybe I have one single color in mind or I am have a few colors I am trying to decide between for the main color of my page. Off to <a href="http://www.color-hex.com/">color-hex.com</a> I go. As the name implies, you provide a hex color and it will give you more information about that color than you thought was possible. Shades/tints of your color? Got em’. Complementary colors? Yup. Color previews on white and black backgrounds as shapes and text? You know it!</p><p>One of my favorite features of color-hex though is that it will provide triadic, analogous and complementary colors to my provided color. What are triadic, analogous and complementary colors you ask? Let’s dive in and find out!</p><h3>Triadic Colors</h3><p>Triadic colors will be any three colors that are exactly three colors away from each other, making a triangle like shape on the color wheel. Now when you are picking colors, they don’t have to be exactly three whole colors away from each other but being close is good as they will provide some sense of balance to your design.</p><h3>Analogous Colors</h3><p>Analogous colors are any three colors that are right next to each other other the color wheel. Using analogous colors will create a natural blend and flow of your colors. There also won’t be any harsh changes in the colors that can be distracting or hard to look at.</p><h3>Complementary Colors</h3><p>Complementary colors are colors that are on the exact opposite side of the color wheel. These colors can be used to effectively create a contrast to each other. Complementary color play off the other color well and can often go well next to each other.</p><p>Take a peek at this color wheel to get an idea of how the color schemes can work together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*D-N0ABJn7NhzyDYp.png" /></figure><h3>How many colors can I pick?</h3><p>Great question! I am by no means the rule maker on this but I usually try to stick with three colors in a design. This generally doesn’t include black or white for me. Why three? That gives you enough colors to be able to be able to create some separation in your design but not too many colors that your design begins to feel busy. If I am really feeling adventurous I will sometimes go up to five colors. I know, don’t tell my mom and dad.</p><h3>Text and Backgrounds</h3><p>Take another look at the very first demos above. Remember how awful that blue text on that yellow background was? It is jarring to look at. Now compare that to the black gradient background with the salmon colored text. The contrast from the dark to lighter color works really well together. One thing that I cannot stress enough is that text should have a high contrast to the background it is on. This will make it much easier to read for just about everyone. One interesting note though is that using a black text on a white background looks fantastic but when used on the web can cause a strain on the users eyes.</p><blockquote>But Bryan, like every single website uses white background and black text</blockquote><p>Not so. One very popular website, Medium, uses a white background (#fff) but if you take a peek at their font color it has a slight opacity to it (rgba(0,0,0,.84)) that makes it not so hard on the eyes. A website like Medium depends on viewers being willing to read their articles and ideally multiple articles in one sitting so cutting down on that high contrast will help with some of the stress it can cause on the eyes.</p><p>Ultimately, these are all suggestions and there is nothing I love more than throwing suggestions to the wind and doing my own thing, it is how I have learned the very most. Who knows, maybe you will read this and think “I am going to make X an Y color really cool together” and that will become the coolest way to design a website. Look at the comeback gradients have made since Instagram completely changed their logo. Go ahead, go crazy and try something new.</p><p><em>Originally published at </em><a href="https://www.frontamentals.com/guide-to-color"><em>www.frontamentals.com</em></a><em>.</em></p><figure><a href="http://bit.ly/codeburst"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hPOj27LTt0ZPn5TQuhZg.png" /></a></figure><blockquote>✉️ <em>Subscribe to </em>CodeBurst’s<em> once-weekly </em><a href="http://bit.ly/codeburst-email"><strong><em>Email Blast</em></strong></a><strong><em>, </em></strong>🐦 <em>Follow </em>CodeBurst<em> on </em><a href="http://bit.ly/codeburst-twitter"><strong><em>Twitter</em></strong></a><em>, view </em>🗺️ <a href="http://bit.ly/2018-web-dev-roadmap"><strong><em>The 2018 Web Developer Roadmap</em></strong></a><em>, and </em>🕸️ <a href="http://bit.ly/learn-web-dev-codeburst"><strong><em>Learn Full Stack Web Development</em></strong></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71fd92268113" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/guide-to-color-71fd92268113">Guide to Color</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unboxing the basics of the CSS Box Model]]></title>
            <link>https://medium.com/free-code-camp/css-box-model-b3e68ceea756?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3e68ceea756</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 21:12:27 GMT</pubDate>
            <atom:updated>2018-03-20T04:07:39.676Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*1ch1pHZSb3YDog3PlZ7oFQ.jpeg" /></figure><p>Understanding the CSS Box Model is crucial in being able to master how elements are laid out on a page. In the most basic of terms, the Box Model is as follows: margin, border, padding and content. But what does that all mean? How do these words work together?</p><p><em>Welp.</em></p><p>In this week’s post we’ll jump right into it and have you feeling like a Box Model Master. Styling elements and giving them proper spacing left and right (and top and bottom…get it? Because you are arranging your elements on the page 😂…sorry for the bad jokes).</p><p>Take a peek at this visual break down provided by the Chrome Console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*fL7IZ5XJwHsQth-a.png" /><figcaption>You can see this visual by right-clicking your page in Chrome (or your browser of choice), clicking Inspect to open the developer console, selecting the Styles tab and then scrolling down to the very bottom.</figcaption></figure><p>You can see that each part of the Box Model is labeled for you except content — that’s the blue box in the very middle. Let’s break down how each part works and the unique differences between them.</p><h3>Margin</h3><p>You can think of the margin as a buffer for your element. Want a little space around your element? That is what margin is there for. Let’s imagine you have a cold. You should (hopefully) be staying away from people so you don’t spread it around. You need some margin around you. Take a look at this image to further illustrate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*oN7zT5zI3B4lfjED.png" /></figure><p>Notice how your friends are all spread out from you and you’re surrounded by orange? That is margin in action. You remain the same size but there is a no-entry zone for all things around you. Same thing goes for elements on your page. Margin will give you space around your element and keep things separated. To put it simply, margin will put invisible spacing around your element without directly affecting its size. In this example we’ve made it orange to give you a visual cue of where it stands in relation to the content (a sick you in this case).</p><h3>Border</h3><p>Border is the second property from outside edge of your element. Border, as you may have guessed, is used to define a visual edge to your element. Border will increase the presentational size of your element or the part that is visually seen on the screen. There can still be margin involved, but it will be on the outside edge of the border. Lets take another look at you being sick, but this time with a little border involved:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*0SJmRV2kv6hOH4uw.png" /></figure><p>It looks almost identical to the margin demo before, except there is now a black box around it. That is our border. One thing to remember is that our content (the sick emoji) is now the size of the emoji plus the border on each side.</p><p>Okay, enough of the sick emoji. Let’s talk about padding.</p><h3>Padding</h3><p>Padding is the third item from the outside edge. And, like the margin and border before it, is totally optional. The biggest thing to keep in mind when trying to find the difference between margin and padding is that padding WILL increase the presentational size of your element.</p><p>Let’s imagine your grandmother is sending you a birthday gift. She packs it up and sends it off in the mail. Now, being that your grandmother doesn’t want your present to get ruined while being sent to you, she really adds to the packaging. Here is a visual for what I mean:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*4BcD7TiSsoCxd2fo.png" /></figure><p>You receive the gift and assume that grandma went all out and got you a 60 inch TV.</p><p>Wrong.</p><p>She just added some padding (see what I did there?) to the box that made it take up more space and appear bigger.</p><p>Let me give you a relevant coding example. You create a &lt;div&gt; that is 100px wide by 100px tall. You add 10px of padding to each edge, and now that &lt;div&gt; is 120px wide by 120px tall because of the added padding on each side. Keep that in mind as you are laying out the elements of your page.</p><h3>Content</h3><p>Content, content, content. This is what our page is made of. Content is how you initially describe it in your CSS or its natural height if you are using an image. You created a &lt;div&gt; that is 50px wide by 300px tall? That is how much real estate on your screen it will take if it isn&#39;t altered by any of the above parts of the Box Model. Content is the present your Grandma gave you, it is the sick emoji.</p><h3>Box Sizing</h3><p>I would be remiss if I didn’t mention box-sizing: border-box right now. I don&#39;t want to dive too deep into the specifics of it, but there is a CSS property called box-sizing that defaults to content-box for its value. Take a look at this CodePen to demonstrate. The children have no respect of the parent container, extending out of it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FKQLvwL%3Fheight%3D600%26slug-hash%3DKQLvwL%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FKQLvwL&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.KQLvwL.small.36797995-5c86-4b2e-8632-ab377064436f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/9df49c024ef3bec4302491a5eeea36cf/href">https://medium.com/media/9df49c024ef3bec4302491a5eeea36cf/href</a></iframe><p>And now with the power that is box-sizing: border-box:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FvdwJNW%3Fheight%3D600%26slug-hash%3DvdwJNW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FvdwJNW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.vdwJNW.small.614a7322-39d7-4eeb-92b2-4fbad696121c.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4cd5b2ba841cb00ffb58ab9e951820f/href">https://medium.com/media/f4cd5b2ba841cb00ffb58ab9e951820f/href</a></iframe><p>The children are now contained inside of the parent (and probably doing their chores and coming home by curfew). The CSS is exactly the same in each demo, except for one small addition to the second one:</p><pre>*, *:before, *:after { <br>  box-sizing: border-box; <br>}</pre><p>These three lines of code are telling every element on our page to calculate their width and height with border and padding added to it, whereas the first demo was a free wheelin’ mess that didn’t respect anyone or anything. The padding and border were added to the width and flowed outside of the parent container.</p><h3>Wrapping it all up</h3><p>The box model is fundamental to understanding how things will lay out on your page. Hopefully, you now have a great understanding of how the Box Model works and how you can use it to your advantage. I also hope this means no more typing “margin: 10px;…[wait for page changes…delete, delete, delete] padding: 10px…”.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fd2YVk2ZRuQuqvVlu%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fpsa-the-more-you-know-public-service-announcement-d2YVk2ZRuQuqvVlu&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fd2YVk2ZRuQuqvVlu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="217" frameborder="0" scrolling="no"><a href="https://medium.com/media/24f95daa76b4a7bff95c687898b9361f/href">https://medium.com/media/24f95daa76b4a7bff95c687898b9361f/href</a></iframe><p><em>Originally published at </em><a href="https://www.frontamentals.com/css-box-model"><em>www.frontamentals.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3e68ceea756" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/css-box-model-b3e68ceea756">Unboxing the basics of the CSS Box Model</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to CSS]]></title>
            <link>https://codeburst.io/intro-to-css-e163247d4123?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/e163247d4123</guid>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 21:10:53 GMT</pubDate>
            <atom:updated>2018-03-15T13:14:02.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XUDp0ZNbFHv22pbpj2N3w.jpeg" /></figure><p>In todays post we are going to cover CSS at a high level but don’t you worry, similar to how we did with HTML, we will drill down on different topics in later posts. Oh, we also haven’t covered HTML in great depth either and there will be plenty more posts to wet your HTML whistle.</p><p>In our <a href="https://www.frontamentals.com/html-intro">Intro to HTML</a> post, we compare HTML to a skeleton. HTML is the layout of our site and can be done in many different ways similar to how our individual bodies can be. CSS is what makes up the appearance of your site, to some effect. It is the makeup and clothes that we apply to our site to make it (hopefully) look great.</p><h3>What even is CSS?</h3><p>CSS is what gives your page some style, some beauty. CSS is the difference between this:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FNyLmZe%3Fheight%3D600%26slug-hash%3DNyLmZe%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FNyLmZe&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.NyLmZe.small.d4f07006-c0a5-425b-9907-37fc16d55481.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7b5c9189d5995edd69e2e4f3992c972/href">https://medium.com/media/a7b5c9189d5995edd69e2e4f3992c972/href</a></iframe><p>And this:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FbLxyGO%3Fheight%3D600%26slug-hash%3DbLxyGO%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FbLxyGO&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.bLxyGO.small.7923ea2d-9281-41e5-a5b9-4a525e7e91d2.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ab87f9fff2c34f0d463cdb19274b7ae/href">https://medium.com/media/2ab87f9fff2c34f0d463cdb19274b7ae/href</a></iframe><p>Do they accomplish the same thing? Yes, but I am willing to bet you interacted with the styled one more.</p><h3>A little history</h3><p>CSS stands for Cascading Style Sheet. It was developed in the mid 90’s by two gentlemen named Bert Bos and Håkon Wium Lie. CSS was initially created to create a separation of content and presentation on your site.</p><blockquote>“BUT WHAT DOES THAT EVEN MEAN?”</blockquote><blockquote><em>-You</em></blockquote><p>You are likely a human. You look similar to other humans (content) but you have the ability to look different by the way that you dress yourself along with makeup (presentation), if that is your thing. And don’t worry, before you get your jimmies rustled, you are a unique flower in a field of other flowers. Don’t let anyone tell you differently.</p><p>CSS was also created to make it easy to share multiple styles on different pages by using a shared .css file. All that is needed to be included is a link to a style sheet on each page and BAM your pages are looking similar. This means less code to write and maintain which is and always will be a principle to be followed.</p><h3>Structure</h3><p>CSS can be included in your page in many different ways. You could go inline, like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a7f676fb1ff49670f41bd67d0ecbba9/href">https://medium.com/media/0a7f676fb1ff49670f41bd67d0ecbba9/href</a></iframe><p>But this approach should be avoided. We will talk about why in just a bit.</p><p>You could go a &lt;style&gt;&lt;/style&gt; tag approach in the &lt;head&gt; of your HTML file like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58f2dba096c85659927ddfc249ad8f65/href">https://medium.com/media/58f2dba096c85659927ddfc249ad8f65/href</a></iframe><p>But guess what? There is a better way that will make your life a little easier. Now stay with me here but as you get started with web development you should keep your HTML out of your CSS (that goes for JavaScript as well) so your files are only containing information that they actually should. It can be easy to just include all your CSS in the &lt;head&gt; (and all of your JavaScript at the end of your HTML in a &lt;script&gt; tag) but it is also easy to not pay any taxes but here we are, payin&#39; taxes.</p><p>Now let me stop you right there. We are talking about basic, introductory HTML and CSS (and a little JavaScript). I am not talking about React or anything else like that. Eventually you will get to a point where including all of the information about your site is cool but that time will come with more experience.</p><p>Okay, okay back to CSS. The best way to include CSS into your site is with a &lt;link&gt; tag in the head of your HTML file. Check this out:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39a91b84ee0ec0a5de4420694bbc3ebd/href">https://medium.com/media/39a91b84ee0ec0a5de4420694bbc3ebd/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d9a3ec2be7d107d1f735c6e5f8b8714/href">https://medium.com/media/6d9a3ec2be7d107d1f735c6e5f8b8714/href</a></iframe><p>Now our HTML file will have the specified styles from our style.css file. Isn’t that so cool?</p><p>Now one of the key things I want you to take away from this article is that CSS cascades down, or flows down, like a waterfall in your CSS file.</p><blockquote>“BUT WHAT DOES THAT EVEN MEAN?”</blockquote><blockquote><em>-You, again</em></blockquote><p>Let’s look at this example and then talk about it a little bit more.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FQQVXKG%3Fheight%3D600%26slug-hash%3DQQVXKG%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FQQVXKG&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.QQVXKG.small.2f1bb338-74e8-4aac-a5d6-ad275672ff81.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd8858b97f45c4a39daf6ed747d8a4e4/href">https://medium.com/media/fd8858b97f45c4a39daf6ed747d8a4e4/href</a></iframe><p>Notice that how even though we never specified our &lt;h1&gt;Frontamentals&lt;/h1&gt; to have a color: tomato property, it still is the tomato color. Why is that? Because the styles from the body cascades down onto the&lt;h1&gt;. Cascading is a powerful idea that can really help you write less code but be careful as it can get tricky quick and that is when you start writing CSS that isn&#39;t reusable. I could (and probably will) write a whole article on cascading.</p><p>One more tip that goes hand-in-hand with cascading is that your CSS file should follow a similar structure to your HTML file. Take a look at this example again:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39a91b84ee0ec0a5de4420694bbc3ebd/href">https://medium.com/media/39a91b84ee0ec0a5de4420694bbc3ebd/href</a></iframe><p>Your CSS file should follow a similar structure:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d9a3ec2be7d107d1f735c6e5f8b8714/href">https://medium.com/media/6d9a3ec2be7d107d1f735c6e5f8b8714/href</a></iframe><p>Start with the body tag, move down to the .nav, .hero and finally end at the .bio just like how your HTML is laid out. This approach takes out the guesswork on where to put the CSS that correlates with the HTML.</p><h3>Classes and ID’s</h3><p>How have we gotten this far without talking about classes and ID’s? Who knows, time flies when you are learning. There are quite a few ways to attach a style to your desired tag. We touched on inline styles earlier but those should be avoided as they are the most specific you can be with your CSS and will make it a pain for yourself or future developers. You will generally use two options 1: class or 2: ID, and while there are a couple other options we will stick with these for this intro.</p><p>Let’s talk about being specific, or specificity, in your CSS. Different approaches to styling carry different weights which makes them less or more specific. The higher the specificity, the more precedent that styling will have. Take a look at the following table to illustrate:</p><pre>╔═══════════════╦════════╗<br>║  Specificity  ║ Weight ║<br>╠═══════════════╬════════╣<br>║ Elements      ║      1 ║<br>║ Classes       ║     10 ║<br>║ ID&#39;s          ║    100 ║<br>║ Inline Styles ║   1000 ║<br>╚═══════════════╩════════╝</pre><p>Specificity Weight Elements 1 Classes 10 ID’s 100 Inline Styles 1000</p><p>As you can see, inline styling is going to be pretty difficult to top.</p><blockquote>“BUT WHAT DOES THAT EVE…”</blockquote><p>For the last time, just raise your hand 🙋 to ask a question.</p><p>Let’s say you landed that dream job and you are writing some CSS to make your homepage look great. You forgot to add the styling to your CSS file and instead added it inline. 6 months later a senior developer is working on the homepage redesign and can’t figure out why adjusting a certain class isn’t showing any changes on the site. He spends hours banging his head against a figurative wall because he is too hard headed to ask for help. An entire day wasted.</p><p>Two things here; 1: that senior developer should have stopped and asked for help and 2: you should have included your styling in a CSS file. Your inline styles were more specific than using a class in a CSS file but the developer never thought to look in the actual HTML.</p><p>Now this is where things can get tricky. You can include styling to an element in a lot of different ways as showing by the table above but I like to be more visual as that is how I learn so back to an example! Take a look at the following HTML and CSS. What color will Frontamentals end up being?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95d7c3f93a771273dbd898d5b525175b/href">https://medium.com/media/95d7c3f93a771273dbd898d5b525175b/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfe7500e1509d38c90a995615e49ae42/href">https://medium.com/media/cfe7500e1509d38c90a995615e49ae42/href</a></iframe><p>If you guessed #BADA55, you are right! Let’s break it all down:</p><ol><li>The color starts out tomato because that is applied to the body and nothing else is specified for the color</li><li>Then the .demo parent div is given a color of aquamarine which then cascades down as well</li><li>The aquamarine color is short lived because the parent div also has a ID of #title which gives Frontamentals the color of goldenrod</li><li>Our H1 is then given a color of black because even though a ID has more weight, the H1 is more specific as it is the actual tag we are styling</li><li>We then apply the color #BADA55 to our H1</li><li>But why doesn’t the hideous blue color get applied? Because ID’s are more specific than classes so the .heading-class will never be applied, even though it is further down.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FbLxPQW%3Fheight%3D600%26slug-hash%3DbLxPQW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FbLxPQW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.bLxPQW.small.a7d914cf-9992-40d6-a966-06b98bbad475.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/142d516fdddd7ac73a62f919e45b1eec/href">https://medium.com/media/142d516fdddd7ac73a62f919e45b1eec/href</a></iframe><p>To recap:</p><ul><li>Styling can be done many ways but when starting out should be done in a separate style sheet from your HTML</li><li>Styling is generally applied via a class or ID</li><li>CSS cascades, or flows down, top to bottom</li><li>CSS respects the different specificity of elements, classes, ID’s and inline styling.</li></ul><p>Learn something new? Feel like I missed something? Hit me up on <a href="https://twitter.com/beeg_smith">Twitter @beeg_smith</a> and let me know your thoughts!</p><p><em>Originally published at </em><a href="https://www.frontamentals.com/intro-to-css"><em>www.frontamentals.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e163247d4123" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/intro-to-css-e163247d4123">Intro to CSS</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Practical guide to Images]]></title>
            <link>https://codeburst.io/practical-guide-to-images-3d763bc36ac5?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d763bc36ac5</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[image]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Fri, 02 Mar 2018 15:26:23 GMT</pubDate>
            <atom:updated>2018-03-03T15:36:07.933Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4YCXZND6yUumwfS7H1pWg.jpeg" /></figure><p>I absolutely love pictures. As a kid, I would go to the library and check out research books because I felt that they had the best looking pictures. I love photography as well. Most of all, I love the story a picture can tell without any words at all. A well placed image can do more for the vibe of a site than almost anything. There are quite a few ways to accomplish the goal of getting an image on your site so let’s talks about those different ways and some optimization tips along the way!</p><h3>&lt;img&gt; tag</h3><p>Take a peek at this code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c715a19ccea8fd614e6b9944985714a4/href">https://medium.com/media/c715a19ccea8fd614e6b9944985714a4/href</a></iframe><p>You will notice that there is a src and a alt attribute. Only the src attribute is technically required for our image to work but going back to our <a href="https://www.frontamentals.com/html-nesting">HTML Nesting</a> post, we want the web to be accessible so I am going to tell you that the alt attribute is required and you should always include it. There are a handful of other attributes as well that we will cover a bit later on.</p><h3>src attribute</h3><p>The src attribute is telling our &lt;img&gt; tag where it can find the image to display. In the example above, it is saying that our image lives in the same directory as we are currently in and is named images.jpg. If the image I wanted to include was hosted somewhere else on the web, I could have included a URL there instead. Don&#39;t do that unless you are 100% certain that your image will always be hosted at the location you a referencing. You may be saying right now:</p><blockquote><em>“Of course my image will always be hosted at that location…”</em></blockquote><p>STOP. THAT. THINKING. Did you ever use MySpace? Exactly. I don’t know anyone who regularly uses MySpace anymore but at one time it was <em>the</em> social network. You could always rely on your top 8 to exist and link to their images. Then Facebook came out and that brings us to today. It is better to reference your images locally. When I say locally, I mean in your project. Create an images folder in your project and reference the image from there.</p><p>Along those same lines, don’t ever, ever, ever steal images off the internet. No matter how cool that picture is, someone else worked to create it. There are so many free options for pictures and it is lazy to do a Google search and take the first one that looks cool. You are better than that.</p><h3>srcset &amp; sizes attributes</h3><p>What’s this? srcset? sizes?</p><p>You, like a lot of people, enjoy surfing the web 🏄. You like to do it on your laptop, you like to do it on your phone. You also, like some developers, enjoy creating websites that look great on both a laptop and a phone. If you are still reading then srcset and sizes is for you!</p><p>Take a peek at this code and we will breakdown what I am talking about:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d5ab50015f6f31fdc32d8820cbcbe84/href">https://medium.com/media/0d5ab50015f6f31fdc32d8820cbcbe84/href</a></iframe><p>Don’t worry if this all feels like a lot right now, because it is! You are probably even thinking to yourself “I thought web development was getting easier! This looks more difficult to me.” There is definitely more information here than we saw before but here is the big win; optimization. It is one thing to have a great looking site and it is another to have a great looking site that loads fast. The only people that are willing to wait around for your site to load are you and possibly a loved one and even then that is a stretch. One of the biggest causes of a slow loading page is poorly optimized images.</p><p>Quick recap on me: I am Bryan, I love to code and spend time with my family and I work as an instructor at a coding boot camp. Nice to meet you.</p><p>All too often when I am helping a student that is creating an image intensive website, I will see page load times up near 6 or 7 seconds. Luckily, there are a lot of tools we use that help with this out of the box (Gatsby &amp; Create React App to name a few). I will inspect an image and in some cases they will be sending an enormous 10MB image down to be displayed. Sometimes that image is even being shrunk down with CSS to only be about 300 pixels wide. That is just too much wasted time. This is where srcset and sizes come into play. Let&#39;s look at the above code snippet again and then break down what is happening.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d5ab50015f6f31fdc32d8820cbcbe84/href">https://medium.com/media/0d5ab50015f6f31fdc32d8820cbcbe84/href</a></iframe><p>srcset is allowing us to send over a group of sizes the browser can choose from. It goes in this order nameOfImage -&gt; images width using w NOT px -&gt; ,. This will give us greater flexibility when loading images in the browser.</p><p>Next, sizes is what will give the browser some clues as to what needs to happen. Essentially the browser will evaluate the sizes attribute and when it evaluates to true, it will select the image that will best fit in the predefined size. I&#39;ll explain further. Pretend to be your favorite browser. You see an img tag and then need to decide what image will best fit our current resolution.</p><ul><li>Is our resolution 320 pixels or less? Nope. Keep going.</li><li>Is our resolution 480 pixels or less but more than 320 pixels? No. Keep going.</li><li>Is our resolution less than 800 pixels but more than 480? Yes! Great, load the image into a width of 770 pixels.</li></ul><p>The 1200px size is for anything that doesn’t fit that criteria and will be used on wider screens.</p><blockquote><em>“What is the benefit?”</em></blockquote><p>The benefit is that instead of always sending that enormous, 10MB image to be downloaded by the browser, you sent a much smaller image that was only half that size and saved you a considerable amount of load time. Your users loved it and an investor wants to give you so much money for your awesome website. Congratulations!</p><blockquote><em>“What is the drawback?”</em></blockquote><p>The biggest drawback is that you will have to have or create all of the sizes of images you specified in srcset and sometimes that can be more easily said than done. Not to be worried though, we will talk about some other optimization options when we only have a single image to work with.</p><h3>alt attribute</h3><p>The alt attribute is text that will display when the image isn&#39;t there and is helpful text for screen readers. Look at these two broken &amp;&lt;img&gt; tags:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*MM5cqKxQHbfqMYQrHWFJTw.png" /></figure><p>And</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*ljnrNefiKQSZXlBoB1DaMw.png" /></figure><p>Notice how the second image has text to go along with it but the first is just a sad display of 404’s. If for whatever reason your image didn’t properly load, your users would be out of luck knowing what the image was of. What a horrible user experience.</p><p>Oh, one more thing on alt tags is that you don&#39;t need to say alt=&#39;image of...&#39; or alt=&#39;picture of...&#39;, browsers and screen readers are smart and already know from the &lt;img&gt; tag that it is working with an image.</p><h3>height &amp; width attributes</h3><p>You may come across the height and width attributes, especially when your images are being rendered from a server. These two attributes do exactly what you think they will do; adjust the height and width of the image. This type of adjustment is considered inline and should be avoided. You are better off styling your image with CSS. It is a real pain when you can&#39;t figure out why your image is constantly staying at 500 pixels even though you have adjusted it in the CSS and then come to find out it was set inline on the &lt;img&gt; tag. One use case for inline styling is HTML emails. If there is enough demand, I will do a little tutorial for HTML emails which are just their own beast.</p><h3>CSS background: url();</h3><p>Another common option of displaying images on your site is the background property in CSS. This can be used to also change the color of your background. It is common to see it used like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba304244480dcc41d78ccb07659fd2cf/href">https://medium.com/media/ba304244480dcc41d78ccb07659fd2cf/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5ec05235405f31dba143ce97c3e38e0/href">https://medium.com/media/a5ec05235405f31dba143ce97c3e38e0/href</a></iframe><p>Think of the background: url() as similar to the src attribute. Both let the browser know where to find the image to display on the screen. Don&#39;t mind that is says url as it can be a local file as well.</p><p>There are a few properties that run in the same pack, or associate with background: url(). In fact, background: url() is just shorthand for background-image: url(), they work nearly interchangeably. Let me go on mini detour here. CSS has quite a few shorthand, or shortcuts, to make life easier. Instead of typing out</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a184dceb8bd1fcfc4ef3edb73d139ffc/href">https://medium.com/media/a184dceb8bd1fcfc4ef3edb73d139ffc/href</a></iframe><p>We can do the same with background images. Instead of explicitly defining different parts of our image like if we want it to stretch across our div, repeat or be centered, we can combine all of that information right into our background property. Take a peek at the following pen for more details.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FGQQNwM%3Fheight%3D600%26slug-hash%3DGQQNwM%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FGQQNwM&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.GQQNwM.small.40e2b8e8-fe6e-4f82-aad2-be6a56acaf03.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a19f32db43e3ff81dc531910ec565be5/href">https://medium.com/media/a19f32db43e3ff81dc531910ec565be5/href</a></iframe><p>You can see that the two images end up the exact same. On the second image, everything concerning our background image is set right into our background property making it cleaner and less things to worry about as our CSS file grows.</p><h3>&lt;img&gt; tag vs CSS background</h3><p>It can be difficult to know when to use an &lt;img&gt; tag and when to use the background CSS property. Whenever I am deciding which to use I think to myself &quot;Is the image part of the flow of my site? Does the image provide meaning besides its good looks?&quot; If I answer yes to either, I use an &lt;img&gt; tag. Remembering back to <a href="https://www.frontamentals.com/html-intro">Intro to HTML</a>, we want our tags to be semantic or have meaning. If we create a div and put an image as its background, we are saying that the image is mostly their for appearance or we like the way it looks. That is just the baseline I use and it has generally worked out pretty well for me so far but know that there any many different use cases.</p><h3>Optimization</h3><p>Back to sending 10MB pictures to the browser to load. We can greatly increase the speed and performance of our site by optimizing our images. Take a look at these two images and tell me what the difference is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*2zYV6qEDkYJn-Wst.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*iyUKTKgYLYXyWPhj.jpg" /></figure><p>You are probably thinking they are the exact same image. Content-wise, they are the same image. File size-wise they are hugely different. The first image is about 900kb in size and the second? That bad boy is coming in at just over 10MB. That means that the first image is almost 10 times smaller than the second. That might not seem like a big deal and it probably won’t be until you make an Instagram competitor aimed solely at pictures of peoples food. Because you are loading in quite a few images at a time, your site is going to load considerably slower than a site with better optimized images.</p><p>One awesome part of the web is that you don’t have to be skilled in Photoshop to optimize your images. I send most of my images through <a href="https://www.tinyjpg.com/">TinyJPG</a> or <a href="http://optimizilla.com/">Optimizilla</a> even after I’m done in Photoshop and these options are totally free which makes it that much better.</p><h3>Types of Images</h3><p>This post is already getting a little lengthy so I will try to be succinct with this last part. There are many different types of images but the most common you will run into are .jpg, .png, .svg and .gif(just for fun).</p><ul><li><strong>.jpg:</strong> Garden variety image format. Probably the most commonly used.</li><li><strong>.png:</strong> Portable Network Graphic. Looking for an image with a transparent background? Most likely a .png</li><li><strong>.svg:</strong> Scalable Vector Graphic. These images will look good at a wide variety of sizes as they scale very well.</li><li><strong>.gif:</strong> Jif or Gif? Doesn’t matter. Most commonly used for animated images. I pronounce it Hif, just to throw people off.</li></ul><p>To recap:</p><ul><li>Optimize your images so they will load faster</li><li>Use alt attributes to let your users know what is happening</li><li>A little more work in the beginning can go a long way</li></ul><p><em>Originally published at </em><a href="https://www.frontamentals.com/practical-guide-to-images"><em>www.frontamentals.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d763bc36ac5" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/practical-guide-to-images-3d763bc36ac5">Practical guide to Images</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nesting HTML Elements]]></title>
            <link>https://codeburst.io/nesting-html-elements-727eb972b4e9?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/727eb972b4e9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[intro]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Fri, 02 Mar 2018 15:11:37 GMT</pubDate>
            <atom:updated>2018-03-03T15:36:15.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8sdGAkLQZwZvFDYUwqwomg.jpeg" /></figure><p>Nesting is a crucial part of your HTML’s structure. We talked about nesting a bit in a <a href="https://www.frontamentals.com/html-intro">previous post</a> just to get your feet wet but in this post we are going to talk about what nesting is, why it is important and some best practices to get your code looking 👸. A bonus to learning a proper nesting structure? You can use what you learn here in a lot of other parts of your code like JavaScript and SCSS but that is more for another day of learning.</p><h3>✅ This is nesting</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/157c7158a34d61499f218cc040cbf119/href">https://medium.com/media/157c7158a34d61499f218cc040cbf119/href</a></iframe><h3>✅ This is nesting too!</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eda47c3bb931beac4f0e12e3dc11e5e7/href">https://medium.com/media/eda47c3bb931beac4f0e12e3dc11e5e7/href</a></iframe><h3>❌ This is how trust is broken and bad things happen to good people</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3452878c77a51ec2d994579f9e1b8c3c/href">https://medium.com/media/3452878c77a51ec2d994579f9e1b8c3c/href</a></iframe><p>Maybe you are looking at the above examples and thinking:</p><blockquote>Those all seem the same. Why can’t I just code, bro?</blockquote><p>First of all, great question. Secondly, don’t call me bro, man.</p><p>There is a fine line in coding and then coding bad habits. It can be difficult to tell what direction you’re headed, especially when you starting out. I actually quit my very first job as a developer after three whole days because I had no one to look up to or get guidance from (post on finding a good mentor coming soon). My wife nearly killed me. Hopefully Frontamentals can be your online guide.</p><h3>Next stop…Nesting!</h3><p>Let’s imagine you just landed your first job as a developer at Tesla, Google, Facebook, Sweet Consulting Agency (take your pick). Your first assignment is to add in some content to their home page. This is a high profile task because everyone will see it. You crack open DreamWeaver (because in this hypothetical, you are making a lot of bad decisions still) and start hammering away at the code. A couple div’s here. A span there and VOILA you have yourself a beautiful page. You send it to your Quality Assurance team because that is just how your company rolls. You pack up your laptop, head for the bus and slowly drift into a dream state while listening to Kickstart My Heart by Mötley Crüe. You get a Slack notification</p><blockquote>What the HUG is this? Did you code this in Microsoft Word? Don’t come back tomorrow…</blockquote><p>Don’t let this be you. Instead, follow along with these articles and level up those skills.</p><h3>Why is it called nesting?</h3><p>It is called nesting because you are structuring your code to have a parent to child relationship. Check out this example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/135bab4f3cc43247612290ed307ebe08/href">https://medium.com/media/135bab4f3cc43247612290ed307ebe08/href</a></iframe><p>The child divs are all nested within the parent div. I also like to think that if you turn your head it sort of looks like a birds nest. Keep in mind there can also be a several level deep relationship and what were once children, could now be parents to their children. Just like humans.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a50788f9a360eae76e63780e79c286e/href">https://medium.com/media/7a50788f9a360eae76e63780e79c286e/href</a></iframe><p>See how easy it is on the eyes to scan the code and see where each piece of information goes? One day you will be debugging, or trying to find out where something has gone wrong, and thank me for teaching you to structure your code like this.</p><h3>Why you should nest</h3><p>I will say this often throughout Frontamentals but let me make sure it is clear this time</p><h3>YOU CODE FOR YOUR TEAMMATES, NOT YOURSELF</h3><p>You will almost certainly at some point in your career write code someone else will eventually have to work with. Treat others as you would like to be treated and leave it better than you found it. If you are having a difficult time following what is happening, your teammates will too.</p><p>You should also care about proper structure and nesting because it is more accessible meaning that more people can use what you create. Newsflash: Not everyone that uses the internet can see. Some people rely on screen readers to tell them what is happening on the screen. If your HTML looks like you dropped a bunch of tags from 30 feet and kept what stuck, a screen reader won’t have a clue how to decipher it.</p><blockquote>Browsers are advanced now Bryan. They will format it for me…</blockquote><blockquote><em>-Snooty you</em></blockquote><p>One of the best pieces of advice I was ever given was to</p><blockquote><em>“Code your websites like the worst possible user experience will happen. Because it will.”</em></blockquote><p>Eventually you will have a user that isn’t using the latest version of Chrome or Firefox (Hi Grandma 👋). Oh, and they are visually impaired. And they wanted to invest 10 billion Schrute bucks into your site because they heard how cool it was but then their experience was awful. Sad story.</p><p>The biggest piece of advice I can give you is to indent and nest your code as you are doing it. You just cut a huge section of code? Before you paste it somewhere else, fix up your current code. Or better yet, let your text editor or wherever you write your code do it for you. A lot of text editors have some sort of auto-formatter built in. Your co-workers will thank you.</p><p><em>Originally published at </em><a href="https://www.frontamentals.com/html-nesting"><em>www.frontamentals.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=727eb972b4e9" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/nesting-html-elements-727eb972b4e9">Nesting HTML Elements</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to HTML]]></title>
            <link>https://codeburst.io/intro-to-html-d15afa7b6fb5?source=rss-4b499ef02607------2</link>
            <guid isPermaLink="false">https://medium.com/p/d15afa7b6fb5</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Bryan Smith]]></dc:creator>
            <pubDate>Tue, 27 Feb 2018 23:30:47 GMT</pubDate>
            <atom:updated>2018-03-01T13:03:02.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guY9xQQXjF9KJjTdOg_t6A.jpeg" /></figure><p><em>If you haven’t read how we will structure our topics on Frontamentals,</em> <a href="https://www.frontamentals.com/structure">take a peek at this first!</a></p><p>Let’s talk HTML. What is HTML? Why do we need HTML? <em>What does HTML even stand for?</em> In this week’s post, we are going to get you a baseline understanding of HTML so let’s get after it!</p><h3>HyperText Markup Language</h3><p>☝️ That is what HTML stands for, in case you were wondering. It was the early 90’s and the internet was starting to become common in homes thanks to the desktop becoming more affordable. There was a need to be able to effectively structure web pages in a unified way. Enter Tim Berners-Lee. Berners-Lee is a really smart guy that essentially came up with the proposal for HTML. He presented that we use tags to layout different information on our screens in a simple yet meaningful way.</p><h3>But what are tags?</h3><p>I’m glad you asked! To be technical, tags are the &lt; and &gt; that wrap what is called an element. Here on out I will refer to them as tags.</p><p>Let’s think of HTML as a skeleton. Inside of most of us we have our skull, our arm bones, chest bones and so on going down our body that connect us together. Web pages also have a skeleton-like structure and the different parts are separated with tags. Take a look at the following example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0c92c50927b371d2b9aabfd46daeb1f/href">https://medium.com/media/d0c92c50927b371d2b9aabfd46daeb1f/href</a></iframe><p>You can see there is a structure to how things are laid out. It all starts with &lt;!DOCTYPE html&gt;. This is letting your browser know that the page is going to be rendered as HTML. There are some other pieces of data that you can potentially insert along with html but we won&#39;t dive into that now. Notice how !DOCTYPE html is between a &lt;&gt;.</p><h3>&lt;head&gt;&lt;/head&gt; Tag</h3><p>Moving down we have a &lt;head&gt; tag. The &lt;head&gt; tag is what will store important information about our page. Think of the &lt;head&gt; tag as the unique things about the site. We all have traits that make us who we are and web pages do too! Let&#39;s take a look at another example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25a0c710f049e930795481bb030037fb/href">https://medium.com/media/25a0c710f049e930795481bb030037fb/href</a></iframe><p>There is a lot of info that can be added to the &lt;head&gt; tag. The best way to think of what to put in there are the things that your user doesn&#39;t directly need to know about but will help the user and browser behind the scenes.</p><h3>&lt;body&gt;&lt;/body&gt; Tag</h3><p>This is where the magic happens, as they say. What we put into the &lt;body&gt; tag will represent what the user sees on the screen when they visit our page. Let&#39;s build out a navbar for our users.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/caee5bd5c7f827b83cd0e1c2ed4f7a77/href">https://medium.com/media/caee5bd5c7f827b83cd0e1c2ed4f7a77/href</a></iframe><blockquote>Quick side note. I will use CodePen to demonstrate a topic. It is a fantastic tool because you can go in and adjust the code and see the output right on the screen! Here is the above code put into <a href="https://www.frontamentals.com/www.codepen.com">CodePen</a>.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FPQqBXO%3Fheight%3D600%26slug-hash%3DPQqBXO%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FPQqBXO&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.PQqBXO.small.b047f430-3d52-40e9-99d4-ddff8d837e79.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/b54be58e2314ff91901d3991c9887227/href">https://medium.com/media/b54be58e2314ff91901d3991c9887227/href</a></iframe><p>Notice how the only things we see on the screen are Home, About and Contact. Let’s talk about what is happening.</p><p>Let’s start with that &lt;nav&gt; tag. In HTML, we want our tags to be semantic. Semantic is just a fancy way to say that the tag has a specific meaning on the page. In this case, the &lt;nav&gt; is our pages navigation. It is where our users will go to navigate to different pages.</p><p>Inside of the &lt;nav&gt; is a heap of other tags. Not to worry though, we will break each one down together.</p><p>&lt;ul&gt;&lt;/ul&gt; stands for unordered list. There is a similar tag to this called &lt;ol&gt;&lt;/ol&gt; but that is an ordered list. The main difference is that with &lt;ul&gt; you get bullet points next to your list items and with &lt;ol&gt; you get descending numbers.</p><p>Next is an &lt;a&gt;&lt;/a&gt; tag. The &lt;a&gt; stands for anchor. It is most often used to create a link to something within our outside of the page. We can tell the &lt;a&gt; tag where we would like to send our users by using href=&quot;WHERE WE WANT OUR USERS TO GO&quot;. You will see that we wrapped our &lt;li&gt;&lt;/li&gt; tags with our &lt;a&gt; tag. Doing so allows our entire &lt;li&gt; to be clickable.</p><p>You may have already guessed but our next tag &lt;li&gt;&lt;/li&gt; stands for list item. These are the specific items we want our list to contain. It is best practice to use &lt;li&gt;&#39;s inside of &lt;ul&gt; or &lt;ol&gt;.</p><h3>Nesting</h3><p>No, we aren’t talking about parents who are soon going to be bringing new children into their home. We are talking about the layout and indentation of our tags. Notice how our tags are nested, or are children of their parent tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbb2de7f570d7b86f4d794a2b47196f7/href">https://medium.com/media/bbb2de7f570d7b86f4d794a2b47196f7/href</a></iframe><p>When you are structuring your page, keep in mind that their can be multiple levels of nesting. See how the class names in the above example relate to each other. If you don’t want to feel the wrath of your co-workers and even possibly your loved ones, please keep the opening and closing tag indentation (amount of spaces or tabs) the same.</p><h3>TAGS TAGS TAGS</h3><blockquote>How many more tags are there Bryan?</blockquote><p>I’m glad you asked! There are over 80 different tags in HTML. Some of them are incredibly obscure and are rarely used or are on their way out of HTML. Speaking of being on it’s way out, HTML is continuously evolving. It doesn’t quite move at the breakneck speed of JavaScript but it is changing. If you are hell-bent on finding out about each tag and want to see a full list, <a href="https://www.w3.org/TR/html5/semantics.html#semantics">check out this site</a>.</p><h3>Self Closing/Void tags</h3><p>Some tags will automatically “close” themselves. Meaning that you won’t need a trailing &lt;/TAGNAME&gt;. Here are some of the more common void tags;</p><ul><li>&lt;img /&gt;</li><li>&lt;input /&gt;</li><li>&lt;meta /&gt;</li><li>&lt;link /&gt;</li></ul><p>There are several other void tags but these are the ones that I typically use the most. Who knows, maybe you use others 🤷.</p><h3>Inline vs Block</h3><p>Tags can be either inline or block by default. The easiest way to think about this is to think of inline like people in a line. They stand right next to each, side by side. You can think of block like some wooden block you probably played with as a kid. They stacked on top of each other. Check out this CodePen for a visual:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fembed%2Fpreview%2FqxdJRK%3Fheight%3D600%26slug-hash%3DqxdJRK%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2Fbeeg%2Fpen%2FqxdJRK&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F616971.qxdJRK.small.ac39e249-a85b-424b-bf3e-fd6e3b943cca.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/638b18ef0cc13b76fd11ae7a68b03948/href">https://medium.com/media/638b18ef0cc13b76fd11ae7a68b03948/href</a></iframe><p>Notice that the inline tags are side by side, left to right. The block tags are stacked on top of each other. Keep in mind, this isn’t an exhaustive list. There are many other tags but these are the ones that I use most often.</p><p>There is so much more to HTML than what is covered in this post but remember, we will be covering topics in a pattern that is called interleaving. The idea here was to give you a high level overview and then come back to that topic to give your brain a refresh. Felt like this was too basic? Check back in a bit for a deeper dive into the specifics of HTML!</p><p>Thoughts? Questions? Comments? <a href="https://twitter.com/beeg_smith">Reach out on Twitter</a>!</p><p><em>Originally published at </em><a href="https://www.frontamentals.com/html-intro"><em>www.frontamentals.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d15afa7b6fb5" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/intro-to-html-d15afa7b6fb5">Intro to HTML</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>