<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: GalinaLK</title>
    <description>The latest articles on DEV Community by GalinaLK (@galinalk).</description>
    <link>https://dev.to/galinalk</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%2F192296%2F39933fa2-41ce-4b9c-9d42-3e6ee605618b.png</url>
      <title>DEV Community: GalinaLK</title>
      <link>https://dev.to/galinalk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/galinalk"/>
    <language>en</language>
    <item>
      <title>flexbox</title>
      <dc:creator>GalinaLK</dc:creator>
      <pubDate>Wed, 20 Apr 2022 12:48:27 +0000</pubDate>
      <link>https://dev.to/galinalk/flexbox-55bh</link>
      <guid>https://dev.to/galinalk/flexbox-55bh</guid>
      <description>&lt;p&gt;I'll show you flexbox with a few examples from my video on YouTube -  &lt;a href="https://youtu.be/k1CigYz5Tlg"&gt;https://youtu.be/k1CigYz5Tlg&lt;/a&gt;. The images are screenshots.They don't have a good quality but everything is quite simple.&lt;br&gt;
This is a div with a class named container with 3 divs inside with a class called box:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DD9jBaae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4lh68282w456g5nigz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DD9jBaae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4lh68282w456g5nigz3.png" alt="Image description" width="720" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the styling for the container and the boxes:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--84C_1tTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adcvchp16fwvp1k8sfi0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--84C_1tTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adcvchp16fwvp1k8sfi0.png" alt="Image description" width="720" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is what it looks like in the browser:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dIeZvheR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqcoqogasjxz8qctzkr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dIeZvheR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqcoqogasjxz8qctzkr3.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what it looks like when you add display: flex;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VBgnRN9P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22lfr04g5txmwdxsyhmf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VBgnRN9P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22lfr04g5txmwdxsyhmf.png" alt="Image description" width="720" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The items display as a row from left to right, like we read sentences in English.&lt;br&gt;
The gap property creates a gap between the items:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DnbQKiQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jl10pzie6ym3j3yyb33i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DnbQKiQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jl10pzie6ym3j3yyb33i.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;flex-direction: column; will make them display as a column:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ElRJDqa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5d3gdwafroqi6y3p3tt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ElRJDqa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5d3gdwafroqi6y3p3tt.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you add display: flex; the property flex-direction is set to row. When flex-direction is set to row the row is called the main axis. When it's set to column the column is called the main axis. The cross axis is perpendicular to the main axis: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W_URzgh6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvlwevtxjpshvowzllvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W_URzgh6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvlwevtxjpshvowzllvw.png" alt="Image description" width="720" height="1081"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The justify-content property changes their position along the main axis. justify-content: center; will place the items at the center of the container:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uYdXS_66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpzaq2tv8274de2fg6q1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uYdXS_66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpzaq2tv8274de2fg6q1.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The justify-content property changes their position along the main axis. justify-content: center; will place the items at the center of the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cSNisnc1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0hxnofjkw0ge0qafx2ag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cSNisnc1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0hxnofjkw0ge0qafx2ag.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;justify-content: flex-end; will position them at the end of the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2I3exSzs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l00exbxvgu61qh8b3qyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2I3exSzs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l00exbxvgu61qh8b3qyn.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;justify-content: flex-start; will place them at the start of the container:  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kr0bGGvb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckusxb9h3ucgritb9b76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kr0bGGvb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckusxb9h3ucgritb9b76.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;justify-content: space-around; gives every item equal space on both sides (the space between them looks bigger because of the gap):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vMRk90-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xy7w1zz3giebd24rgpg9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vMRk90-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xy7w1zz3giebd24rgpg9.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;justify-content: space-between; create space between them, but not around the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1YKKdB00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nz2qupl8jzvtryu6jzpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1YKKdB00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nz2qupl8jzvtryu6jzpv.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;justify-content: space-equal; makes the space between them and around the container equal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BIKDUb_S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agd8w8a6avphanxppmkf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BIKDUb_S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agd8w8a6avphanxppmkf.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I added height: 80vh; to the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qiydOIJq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lj16zzie7ks4qixxo2sv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qiydOIJq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lj16zzie7ks4qixxo2sv.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is what it looked like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5OhJEV80--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wq31cqfsd6sekshvr7ox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5OhJEV80--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wq31cqfsd6sekshvr7ox.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The items are stretched. This is the default behavior when you add display: flex;&lt;br&gt;
The align-items property aligns them vertically. When it's set to center they're vertically centered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hX5Q_He3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nct8qxko7x0uhoxb3p4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hX5Q_He3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nct8qxko7x0uhoxb3p4g.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the default value:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vrr7B5dE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rj77tq1p8gjmgdqxdw47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vrr7B5dE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rj77tq1p8gjmgdqxdw47.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;align-items: flex-end; will place them at the bottom of the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HjcXwDSV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3slf33m8fdc3i649foy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HjcXwDSV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3slf33m8fdc3i649foy.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;align-items: flex-start; will place them at the top:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2W56cDlN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ftr068vm80oemjzscr6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2W56cDlN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ftr068vm80oemjzscr6g.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The items don't break into multiple lines. I added more items to show you how to make them wrap:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZzyLJgwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nted5mixb8pvak2rg6wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZzyLJgwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nted5mixb8pvak2rg6wa.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I added flex-wrap: wrap; to the container. It will make them wrap onto multiple lines:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--onXL40xf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4txmph899ztge9ubmn4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--onXL40xf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4txmph899ztge9ubmn4z.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;flex-wrap: nowrap; is the default value when you add display: flex;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4YNjHfRl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqgvi955hx4nfqb30qv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4YNjHfRl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqgvi955hx4nfqb30qv2.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I removed the gap and changed the names of these three classes to show you how to make elements bigger than the others when there's available space:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cpzJuzqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etnwmtx4gklqlipjt1ji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cpzJuzqn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etnwmtx4gklqlipjt1ji.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll show you flex-grow. box1 gets flex-grow: 1; &lt;br&gt;
box2 gets flex-grow: 2;&lt;br&gt;
box3 gets flex-grow: 3;&lt;br&gt;
This is what the styling looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YaiewO4A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snhskxjb6gs5acx1wsd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YaiewO4A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snhskxjb6gs5acx1wsd1.png" alt="Image description" width="718" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SIPVMkOn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vrpyd0rtagq8979x396m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SIPVMkOn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vrpyd0rtagq8979x396m.png" alt="Image description" width="681" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2i3GWFyL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr81wnjbdi2jqo937j8c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2i3GWFyL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr81wnjbdi2jqo937j8c.png" alt="Image description" width="691" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;box3 got three parts of the space that is not needed, box2 got two and box1 got one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kVYJz9bl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r82uoue40dn8jpgz188.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kVYJz9bl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r82uoue40dn8jpgz188.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I added another container with a class called container2 with 3 divs inside with classes named child to show you the flex-basis property:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LQjs5Lgr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usfzzqkixr056rxlwzcl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LQjs5Lgr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usfzzqkixr056rxlwzcl.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the styling for container2:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n7K3URhn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6lhhcq9w01tjl9weqta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n7K3URhn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6lhhcq9w01tjl9weqta.png" alt="Image description" width="706" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also added a gap to the container. This is the styling for the items and what they look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zbh0C0k6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98jpt5qemc81jdj7tvib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zbh0C0k6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98jpt5qemc81jdj7tvib.png" alt="Image description" width="720" height="1155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what they look like with flex-basis: 20px;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cwz57KRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12evwnv7b5fajknwdri5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cwz57KRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12evwnv7b5fajknwdri5.png" alt="Image description" width="711" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what they look like with flex-basis: 50px;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gAEt6qoX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qx4qqouk8znt94ls03as.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gAEt6qoX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qx4qqouk8znt94ls03as.png" alt="Image description" width="720" height="883"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this the items with flex-basis: 100px;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--njZP7znn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhxsc6txgrpy58579m5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--njZP7znn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhxsc6txgrpy58579m5b.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;flex-basis changes the length of the elements.&lt;br&gt;
flex-basis: auto; is the default value. It depends on the length of the element or its content if length is not set:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QMLN6Hs4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqzpyeegzkxnvohgzvja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QMLN6Hs4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqzpyeegzkxnvohgzvja.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The elements can grow if we change the flex-grow property.&lt;br&gt;
I'll change two of the class names and delete flex-basis: auto; to show you flex-shrink. Now the second element is has a class named child1 and the third has a class called child2:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q0sJFKcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bgil1ywl05mpydrfkhr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q0sJFKcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bgil1ywl05mpydrfkhr.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ilONLF1I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l533crxugjoecawke8k4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ilONLF1I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l533crxugjoecawke8k4.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll give all divs inside container2 flex-basis: 150; It'll make them so big that there won't be enough room for all of them in the container and they'll have to shrink:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M6AmeiQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghgwh4plirwths19o50p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M6AmeiQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghgwh4plirwths19o50p.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;child1 will get flex-shrink: 1; &lt;br&gt;
child2 will get flex-shrink: 2;&lt;br&gt;
and child3 will get flex-shrink: 3;&lt;br&gt;
This is the styling for the divs inside .container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MRnQehm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pd0c8zpww899fp97l4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MRnQehm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pd0c8zpww899fp97l4t.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DNmSfA9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jfe3k2jkfd55twwwkr2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DNmSfA9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jfe3k2jkfd55twwwkr2.png" alt="Image description" width="693" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;child3 has to shrink 3 times more than the others. With flex-shrink you can choose how big they should be when they have to shrink:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_zVJ7iep--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky7ezupgib59976rmwln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_zVJ7iep--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky7ezupgib59976rmwln.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll give the container a height of 100px to show you the property called order:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6opNj5K5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sayu24pkhby5og49bd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6opNj5K5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sayu24pkhby5og49bd1.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first item will get order: 3;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ENXZT4yL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cz6dxguk8ybmtrsjc2wv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ENXZT4yL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cz6dxguk8ybmtrsjc2wv.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's in the third position. The order property changes the order of the elements:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QTPJRf5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thivogevfpifqhiacsvq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QTPJRf5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thivogevfpifqhiacsvq.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if the order of your items is not correct you should change it in the html file. It's not a good idea to use the order property for that.&lt;/p&gt;

&lt;p&gt;The align-self property changes the position of one element. I'll give child2 align-self: center; It will position it at the center:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gdjC3WJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0k7gcpshjn1imeq2qcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gdjC3WJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0k7gcpshjn1imeq2qcx.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;align-self: stretch; will stretch it. That's the default:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ouiMQmUh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mncl5k4rtbfbqeardlsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ouiMQmUh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mncl5k4rtbfbqeardlsz.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;align-self: flex-start; will put it at the top of the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--irlC9WVI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83g8zbpqj55qzx4nj716.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--irlC9WVI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83g8zbpqj55qzx4nj716.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With align-self set to flex-end the item will be at the bottom of the container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXpF9QA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mktus95hyw1jwxklo1l5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXpF9QA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mktus95hyw1jwxklo1l5.png" alt="Image description" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>Navbar React js </title>
      <dc:creator>GalinaLK</dc:creator>
      <pubDate>Mon, 21 Feb 2022 09:53:05 +0000</pubDate>
      <link>https://dev.to/galinalk/navbar-react-js-12dl</link>
      <guid>https://dev.to/galinalk/navbar-react-js-12dl</guid>
      <description>&lt;p&gt;I made a navbar with Sass that is responsive and looks good on both desktop and mobile devices. This is what it looks like on a desktop screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j9-2lGzh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2iref282hbvpactbi7p1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j9-2lGzh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2iref282hbvpactbi7p1.jpg" alt="Image description" width="880" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is what it looks like on a small screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XTSvsQwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rl2ooit2hiiqkgczcz88.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XTSvsQwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rl2ooit2hiiqkgczcz88.jpg" alt="Image description" width="557" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tZBYPvab--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmvdseeufms4lhous2c7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tZBYPvab--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmvdseeufms4lhous2c7.jpg" alt="Image description" width="558" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The navbar is in a component called Header because the nav tag is inside a header. The Header is in App.js:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Cff6CHn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cda4nzw1mbuogsdvm4i5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Cff6CHn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cda4nzw1mbuogsdvm4i5.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logo, useState, Link and header.scss are imported in Header.js:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yKIq20BC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/613mzkfwkv80yu75htx9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yKIq20BC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/613mzkfwkv80yu75htx9.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used the keyboard on the screen and on my phone because my phone is connected to a PC. I write code on my phone because it's way easier than typing on a keyboard. In this way you can turn on your computer in the morning and code with just a phone wherever you are. I think it's a good idea to unplug it at the end of the day. &lt;br&gt;
I try to avoid using divs but I needed them to style it. There's a div that's always on top and an unordered list for the hamburger menu inside the nav element:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qnglVZJi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9trl3hlrdgqgh2qbiuwl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qnglVZJi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9trl3hlrdgqgh2qbiuwl.jpg" alt="Image description" width="880" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The header has its position set to sticky so that when you scroll down it stays at the same place. The logo, search bar and the button that opens the menu are in the class named "top-nav":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MvDXHGBO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wobpcmqu72kw1ampn1hj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MvDXHGBO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wobpcmqu72kw1ampn1hj.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;amp;#8811 is an arrow. HTML has so many symbols and emojis that are easy to use, you just have to copy their code. But I also used the "fa fa-bar" icon from Font awesome, which is probably not a good idea because it makes it slower. This is what the lighthouse report showed me: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j22fWDhy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iaymw1s9yoyyynvzjlpt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j22fWDhy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iaymw1s9yoyyynvzjlpt.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The nav menu items are links in an unordered list. It's mobile first, so they're hidden by default:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--udbPUw0k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/llkrlxg74snxr0udqivu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--udbPUw0k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/llkrlxg74snxr0udqivu.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I didn't want to use a div and spans for the hamburger menu because they're just basic containers and that's not good for screen readers. We should use buttons even if it's not very beautiful. And we should even avoid using icons and use descriptive words instead. Many different people will try to figure out what's going on and some might not have much experience. When I was a kid a lot of sites seemed to be very confusing. &lt;br&gt;
The function showHam toggles the class named "hidden" and the if-else block removes one icon and adds another one depending on what the user should see at this point. It uses the variable hamClosed to change the icon: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--whp-A53R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17hvclryx0aug54ix7nk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--whp-A53R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17hvclryx0aug54ix7nk.jpg" alt="Image description" width="880" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logo is avif, because I wanted to use a photo and they're tiny. &lt;br&gt;
These variables are placed in _variables.scss so I can change all the colors real quick:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bDIg7JmQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqxscqkzfcigc53x8v7z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bDIg7JmQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqxscqkzfcigc53x8v7z.jpg" alt="Image description" width="880" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And _variables.scss is imported in header.scss:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FerjnKS7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfzyqaimk6gyr44dpa69.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FerjnKS7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfzyqaimk6gyr44dpa69.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"nav-desc" has two direct children - a div for the things that will always stay on top (the logo, search bar and hamburger menu) and an unordered list with links for the menu. They stack on top of each other on small screens because "nav-desc" has a "display: flex" and "flex-direction" is set to "column". Here's the styling:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KvoV75re--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wr6tgclv6ukeyisjqsiz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KvoV75re--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wr6tgclv6ukeyisjqsiz.jpg" alt="Image description" width="880" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the css for the button, the logo and Link inside "top-nav":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yTNtT2nq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vdcv47b7wnoys3sefx4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yTNtT2nq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vdcv47b7wnoys3sefx4.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And also, the search bar, the submit button and the hover effect of the menu:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I6hNL268--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kougy9qcs4l4opejt4p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I6hNL268--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kougy9qcs4l4opejt4p.jpg" alt="Image description" width="880" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lc7w5XRW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a21cccu0funcuz78li0z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lc7w5XRW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a21cccu0funcuz78li0z.jpg" alt="Image description" width="880" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On big screens the button that opens the hamburger menu has a display property set to "none". The "flex-direction" property of the hamburger menu is set to row so they're placed horizontally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--876KKIdu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lawfcbc7t2bj8le4ga5u.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--876KKIdu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lawfcbc7t2bj8le4ga5u.jpg" alt="Image description" width="880" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XM8DGf9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3ln7ojqt8walu9bxsy4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XM8DGf9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3ln7ojqt8walu9bxsy4.jpg" alt="Image description" width="880" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Too much styling will make it slower. The users will want to see the content, not the styling, so I think it's a good idea to make a few elements a little different so that it looks good, without changing the others.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
