<?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>Forem: Breeana Payton</title>
    <description>The latest articles on Forem by Breeana Payton (@paytondev).</description>
    <link>https://forem.com/paytondev</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%2F683877%2F64932084-1d8e-4d90-913b-b38d690c579d.jpg</url>
      <title>Forem: Breeana Payton</title>
      <link>https://forem.com/paytondev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/paytondev"/>
    <language>en</language>
    <item>
      <title>You Should Make Templates</title>
      <dc:creator>Breeana Payton</dc:creator>
      <pubDate>Mon, 13 Sep 2021 11:36:03 +0000</pubDate>
      <link>https://forem.com/paytondev/you-should-make-templates-32mi</link>
      <guid>https://forem.com/paytondev/you-should-make-templates-32mi</guid>
      <description>&lt;p&gt;One of the first lessons most developers learn in improving their code is the DRY (Don't Repeat Yourself) standard. Simply put, if you have to write that same component twice but with different content, you need to refactor. The problem I see is that most developers only apply this to the code and not their processes. This is where templates come in. Here are 3 immediate improvements to your project process if you take time to template your most used designs and components.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Increased Speed
&lt;/h2&gt;

&lt;p&gt;How many times have you retyped an entire Navbar/Hero Section/Sidebar in a new project? Wouldn't it have been easier to copy that Navbar from the last project and make small changes. If in React, you could style the component, add props for customization (background color, font-size, etc.), save it to a "favorite components" folder, and import those components when needed. This cuts down future build time significantly.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Easy Practice
&lt;/h2&gt;

&lt;p&gt;Consistent practice is one of the harder parts of learning to code. This is sometimes because developers burn out on Javascript challenges or building entire projects. What if you only have 20 minutes today? Building a styled footer that you can use for your next project should take just that amount of time. It's a creative break from the "logic grind" and still productive.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Develop A Signature Style
&lt;/h2&gt;

&lt;p&gt;Imagine having a library of 25 custom Bootstrap Cards to choose from? What if you displayed them on a site as a project show to recruiters or clients? It would be an easy way to say "This is my style of design" and would show your ability to create reusable components. As a bonus, this would also show your dedication and passion to code.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Overall, templating code can greatly improve your process by making it more seamless while also creating practice for the core elements of Frontend Development.&lt;/p&gt;

&lt;p&gt;I hope this convinces you to store some of your favorite elements today. If you have some that you'd like to share, comment your GitHub profile below. I'd love to see!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>VS Code Shortcuts</title>
      <dc:creator>Breeana Payton</dc:creator>
      <pubDate>Wed, 11 Aug 2021 15:02:04 +0000</pubDate>
      <link>https://forem.com/paytondev/vs-code-shortcuts-273l</link>
      <guid>https://forem.com/paytondev/vs-code-shortcuts-273l</guid>
      <description>&lt;p&gt;I remember starting out with HTML and hating when I had to code a list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Question&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Question&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Question&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Question&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Question&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- And so on... --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Though you could use copy and paste I couldn't imagine that developers would use such a slow method when it is their passion to make software more efficient. So I did some research and here are 3 of the shortcuts I came across that I now use everyday.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Copy the Line Without "Ctrl (Windows)/Command (Mac) + C"
&lt;/h2&gt;

&lt;p&gt;You can copy a line of code without having to highlight, copy, and paste. Put your cursor on the line of code you want to copy, hold Shift + Alt/Option and press the down or up arrow key if you need to copy the line above or below. It looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R2M7AH-5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wo98vpbxdpnqrpbt9gbp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R2M7AH-5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wo98vpbxdpnqrpbt9gbp.gif" alt="Gif Of A Line Of Code Being Copied"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Edit Multiple Lines at Once
&lt;/h2&gt;

&lt;p&gt;What if you needed to change that list of questions to now be a list of answers? Instead of highlighting line by line you can now select multiple lines by holding Alt (Windows)/Option (Mac):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F7ePoJ98--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3sa5ji4j6vzm75jzfhb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F7ePoJ98--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3sa5ji4j6vzm75jzfhb.gif" alt="Gif Of Multi Line Editing"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Use Emmet Abbreviations
&lt;/h2&gt;

&lt;p&gt;So I've made my list, but now I realize that they all need an id if I want to be able to manipulate them individually in Javascript. IDs have to be unique. Do I need to edit line by line? What if there were 100 of these?&lt;/p&gt;

&lt;p&gt;This issue could have been prevented using Emmet, a tool built into VS Code (and a lot of other code editors) that includes a ton of code shortcuts for some basic languages. The shortcut that would solve my problem looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FzpQ2LWx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qllw2mmtrlvlvi5v9cvg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FzpQ2LWx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qllw2mmtrlvlvi5v9cvg.gif" alt="Emmet Abbreviation Example Gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that first line looks a bit insane:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ul&amp;gt;li#question${Question}*5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me break it down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;"ul": Letting Emmet know I want an unordered list&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"&amp;gt;": This is a "child" signifier. Whatever element follows will be the child of the ul.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"li": I want a li element inside the ul.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"#": The symbol for the id attribute (like in CSS) the text that follows is the value of id. So #question is id="question".&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"$": This is tells Emmet "I want this numbered". By default it starts with 1.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"{}": This is a "text" signifier. This will add text to the nearest element.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"*(number)": This is a "multiplication" signifier. This tells Emmet you want the current element repeated "number" of times. We could replace the 5 in the example with a 20 if we had 20 questions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more Emmet Abbreviations you can visit &lt;a href="https://docs.emmet.io/abbreviations/syntax/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hopefully these can help you speed up your coding a little. If you have any questions about Emmet feel free to comment below. I'm happy to help. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>firstyearincode</category>
      <category>vscode</category>
      <category>html</category>
    </item>
    <item>
      <title>What Is a CRUD App?</title>
      <dc:creator>Breeana Payton</dc:creator>
      <pubDate>Wed, 11 Aug 2021 12:59:25 +0000</pubDate>
      <link>https://forem.com/paytondev/what-is-a-crud-app-4h2e</link>
      <guid>https://forem.com/paytondev/what-is-a-crud-app-4h2e</guid>
      <description>&lt;p&gt;This is a common interview question for Jr. Developer roles and honestly just something all developers should know. Here's a secret though, interviewers aren't looking to see if you know the definition. They want to see &lt;em&gt;how&lt;/em&gt; you explain it. This question test your technical communication skills. The interviewer wants to know, "Can you clearly present a project to developers &lt;strong&gt;and&lt;/strong&gt; clients?" Here's how you can knock this question out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Definition Is the Roadmap
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A CRUD App is an application that lets users Create, Read, Update, and/or Delete content.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simple and sweet but only the beginning. At this point the interviewer knows you can memorize a Google definition. Now you need to show understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tell A Story. Paint a picture.
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;So let's say you have a blog. You as a user can Create/Publish a post, Read/Show your post, Update/Edit your post and Delete your post. Blogs are classic CRUD apps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the interviewer knows you understand the concept but we can take this one step further to make the answer more complete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tie It Back To The Job
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;In web development CRUD functionality is tied to API calls that updates the user's information in a database. Create is tied to a POST request, usually through a submit or publish button. Read ties to GET requests. Update ties to PUT and PATCH requests. Delete ties to DELETE requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There you have it. Now we have answered the question, shown that we understand our answer, and shown that we know why it was asked in the first place. If you have an interview coming and don't understand something I've written here, feel free to leave a comment and I'll discuss this with you.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>firstyearincode</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Copying VS Understanding Code</title>
      <dc:creator>Breeana Payton</dc:creator>
      <pubDate>Wed, 11 Aug 2021 02:55:59 +0000</pubDate>
      <link>https://forem.com/paytondev/copying-vs-understanding-code-1g2g</link>
      <guid>https://forem.com/paytondev/copying-vs-understanding-code-1g2g</guid>
      <description>&lt;p&gt;You need to build a countdown timer for your project. You remember something about setInterval but can't quite place it. You open a tab and see Google staring back. There is a choice here. Do you type "setInterval documentation" or "javascript countdown timer"?&lt;/p&gt;

&lt;p&gt;One of these &lt;strong&gt;teach&lt;/strong&gt; you the answer while the other will simply give it to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Sure You Learn
&lt;/h2&gt;

&lt;p&gt;If you googled the javascript countdown timer one of the first links you'll come across is from Stack Overflow and you'll find a function that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;safeTimerDisplay&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;00:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;sec&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sec&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When coding for companies or bootcamps there will be a code review and you will have to explain your functions. Here are 3 ways that you can prove that you understand the code and make sure that you're learning:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Can you test the code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking back on that timer function could you write a test for &lt;br&gt;
it right now? Which testing library would you use? What would&lt;br&gt;
a fringe case look like? Do you need any extra resources to &lt;br&gt;
test it?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Can you apply the code within a framework/other language?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How do you implement this code within React, Angular, or Vue?&lt;br&gt;
What does this look like in jQuery or Typescript?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Can you explain this function using comments or documentation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a crucial skill to have when contributing to larger &lt;br&gt;
code bases and for debugging. Can you break this code up line &lt;br&gt;
by line and describe what's happening?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you can answer most of these questions congrats! You are leveling up. If not, congrats! You have a new goal to chase. I am still building my skills in these areas as all developers are. I'm just letting you know what I wish my bootcamp teachers would have told me. If you need any help with these questions feel free to comment below. I'm here to help.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
      <category>firstyearincode</category>
    </item>
    <item>
      <title>How To Center A Div Within A Div</title>
      <dc:creator>Breeana Payton</dc:creator>
      <pubDate>Wed, 11 Aug 2021 01:17:19 +0000</pubDate>
      <link>https://forem.com/paytondev/how-to-center-a-div-within-a-div-3fd</link>
      <guid>https://forem.com/paytondev/how-to-center-a-div-within-a-div-3fd</guid>
      <description>&lt;p&gt;I don’t think I’ve met a single soul working in web development who hasn’t googled this more than once. Whether you’re new and trying to finish that first project, or like me and immediately forget everything you’ve learned once you start a project, this is just one of those concepts that takes a while to stick. Either way I won’t judge nor will I waste your time. There are a ton of ways to accomplish this task. I’ll keep it simple and show you my go-to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello Flexbox 👋
&lt;/h2&gt;

&lt;p&gt;Since the goal of most web pages is to make them responsive, using flexbox cuts down on a lot of the work when working on media queries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make sure the &lt;strong&gt;height&lt;/strong&gt; CSS property of both the body and HTML is set to 100%&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure the &lt;strong&gt;display&lt;/strong&gt; CSS property of your parent container is set to flex  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we can apply some CSS and HTML as follows:&lt;/p&gt;

&lt;p&gt;HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"flex-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        I am centered
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#flex-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#31493C&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#flex-item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#FCA311&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p0rZgqbX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71eqi8tjbii2lyprcr6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p0rZgqbX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71eqi8tjbii2lyprcr6z.png" alt="Full screen centered div"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And when you resize the window:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LmzGT09W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6tfzdes5phfgv1qibca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LmzGT09W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6tfzdes5phfgv1qibca.png" alt="Half screen centered div"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simple. Now if you’re a beginner I want you to think about something. There is a line in this code that could give you problems if the “flex-container” isn’t the outermost container. I did this because you shouldn't copy code you don’t fully understand. Tell me which line is the potential issue in the comments below… or yell at me about it. I accept both.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>html</category>
      <category>css</category>
    </item>
  </channel>
</rss>
