<?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: yatendra</title>
    <description>The latest articles on Forem by yatendra (@sharmayatendra).</description>
    <link>https://forem.com/sharmayatendra</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%2F860532%2F6fc5237d-73f4-416e-9d7d-f14e79410ca2.jpeg</url>
      <title>Forem: yatendra</title>
      <link>https://forem.com/sharmayatendra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sharmayatendra"/>
    <language>en</language>
    <item>
      <title>What is React?</title>
      <dc:creator>yatendra</dc:creator>
      <pubDate>Wed, 11 May 2022 16:30:05 +0000</pubDate>
      <link>https://forem.com/sharmayatendra/what-is-react-gmp</link>
      <guid>https://forem.com/sharmayatendra/what-is-react-gmp</guid>
      <description>&lt;p&gt;If you are here you must be a JavaScript developer or if you are not this article will let you start with your React journey the word which currently has boom in the market right now.&lt;/p&gt;

&lt;p&gt;So let's start with your React journey😎.&lt;/p&gt;

&lt;p&gt;So there are mainly 3 things that is responsible for a website HTML, CSS, JavaScript.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;HTML - Structure of a website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS - Styling &amp;amp; design for a website to make it beautiful.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript - To have interactivity in website.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let btn = document.querySelector("#btn");
let counterVal = document.querySelector("#counter-val");
let val = 0;
function increaseCounterVal() {
  val = val + 1;
  counterVal.innerText = val;
}

btn.addEventListener("click", increaseCounterVal);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see how much code we need to write&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First we need to create HTML &lt;/li&gt;
&lt;li&gt;We need to reference each &amp;amp; every part of DOM from HTML world to JS world.&lt;/li&gt;
&lt;li&gt;we need to add event listener to the referenced element.&lt;/li&gt;
&lt;li&gt;we need to tell in our callback function what needs to be done &amp;amp; where it needs to update the value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just for a basic counter example think of a large application where we need to do a lot of DOM manipulation there telling everything ourselves what to do and where to do. This type of programming is called imperative programming.&lt;/p&gt;

&lt;p&gt;So here comes &lt;strong&gt;React&lt;/strong&gt;🚀 for the rescue.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what React actually is?🤔
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React is a JavaScript library which is used to create interactive User Interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Declarative: means we don't need to tell where to do the changes. We will deep dive into this. Hold on for now.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Component Based Approach: You can break your bigger app into smaller smaller components &amp;amp; then combined them to make a complex web app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSX: you can write JavaScript inside HTML tags.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So let's deep dive into this &amp;amp; write our same logic in &lt;strong&gt;react&lt;/strong&gt; for our counter example.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function App() {
  const [counter, setCounter] = useState(0);

  function incrementCounterVal() {
    setCounter((prev) =&amp;gt; prev + 1);
  }
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h1&amp;gt;{counter}&amp;lt;/h1&amp;gt;
      &amp;lt;button onClick={incrementCounterVal}&amp;gt;Click me&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at the above code how simple it is to create a basic counter in react rather than in vanillaJS.&lt;/p&gt;

&lt;p&gt;So how react works is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There is something known as state in react think it of as a variable which can be used to update our UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So we need to use &lt;em&gt;useState&lt;/em&gt; hook which is provided by "react" to us what is does is it returns a state &amp;amp; a setter function through which we can update our state. &lt;code&gt;const [counter,setCounter] = useState(0)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;That's what is happening in the above example we have &lt;em&gt;counter&lt;/em&gt; as state variable taking default value as 0 &amp;amp; &lt;em&gt;setCounter&lt;/em&gt; as our setter function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We have then our HTML tags as similar to that we used in vanillaJS code but here is the catch. JSX is used over here to update our view i.e the updated value of counter means its dynamic value. &lt;code&gt;&amp;lt;h1&amp;gt;{counter}&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We don't need to tell react that we need to update the value here we just simply use our state variable in JSX &amp;amp; it will update our view accordingly. This is known as declarative programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We have then similar button through which we can update our value via passing an &lt;em&gt;onClick&lt;/em&gt; event. It is a synthetic event used in react as similar to that of &lt;em&gt;click&lt;/em&gt; event in vanillaJS. &lt;code&gt;&amp;lt;button onClick={incrementCounterVal}&amp;gt;Click me&amp;lt;/button&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We need to pass our callback also in JSX. This means what is inside that curly braces is JavaScript. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On clicking of button our function &lt;em&gt;incrementCounterVal_will be called then our setter function _setCOunter&lt;/em&gt; will update the counter value by 1 than what it is previous. &lt;code&gt;function incrementCounterVal() {&lt;br&gt;
setCounter((prev) =&amp;gt; prev + 1);&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What setCounter is doing here is that it is updating our counter variable as well as it triggers our component to re-render because our state variable value has changed now so it should get updated into our UI as well.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Important Note &amp;amp; Analogy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Keep always this thing in mind like in Maths we write function as &lt;code&gt;f(x) = x + 1&lt;/code&gt; means value of function depends upon &lt;strong&gt;x&lt;/strong&gt;. So &lt;strong&gt;x&lt;/strong&gt; is a dependent variable here. That concludes if value of &lt;strong&gt;x&lt;/strong&gt; changes function output will change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the similar manner in &lt;strong&gt;React&lt;/strong&gt; &lt;code&gt;f(S) = view&lt;/code&gt; here view means our User Interface whatever we use to see on the screen. So our view is dependent upon the state variable as soon as our state changes our &lt;strong&gt;view&lt;/strong&gt; will going to change.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the whole catch how react works under the hood &amp;amp; makes our life easier to build UI.&lt;/p&gt;

&lt;p&gt;You can play around with both codes used in example shown above:&lt;br&gt;
&lt;a href="https://codesandbox.io/s/inspiring-gagarin-rm77j6"&gt;https://codesandbox.io/s/inspiring-gagarin-rm77j6&lt;/a&gt; (vanillaJS)&lt;br&gt;
&lt;a href="https://codesandbox.io/s/angry-shannon-zr0m6g"&gt;https://codesandbox.io/s/angry-shannon-zr0m6g&lt;/a&gt; (React)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope you have fun reading this article &amp;amp; you can start your React journey now 🚀&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading! Catch you next time !&lt;/p&gt;

&lt;p&gt;PS: Do share your reviews &amp;amp; feedbacks.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>CSS Flex-box Quick Guide</title>
      <dc:creator>yatendra</dc:creator>
      <pubDate>Wed, 11 May 2022 07:14:23 +0000</pubDate>
      <link>https://forem.com/sharmayatendra/css-flex-box-quick-guide-6ji</link>
      <guid>https://forem.com/sharmayatendra/css-flex-box-quick-guide-6ji</guid>
      <description>&lt;p&gt;If you are a Frontend Developer &amp;amp; facing some hard times mainly with the styling part of your website this article is for you🤗.&lt;/p&gt;

&lt;p&gt;The flexbox for a website is mainly used for purpose of layout, and alignment for the children of a container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basics
&lt;/h2&gt;

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

&lt;p&gt;The figure shown above is the basic building block of how the flex property works in CSS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flex Container&lt;/strong&gt;: It is the main container to which CSS display: flex property will be given.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flex Items&lt;/strong&gt;: Children of the main container which will laid out according to the flex-direction property.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main Size&lt;/strong&gt;: Total size i.e "width/height" of the main container in whichever is along the main axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross Size&lt;/strong&gt;: Total size i.e "width/height" of the main container in whichever is along the cross axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main Axis&lt;/strong&gt;: It is the axis along which items are laid out either row/column as in the figure it is in a row. This changes according to the flex-direction property.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross Axis&lt;/strong&gt;: It is the axis perpendicular to the main axis.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Properties
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Properties for flex are divided mainly into two different parts i.e the property for "container" &amp;amp; property for "items".&lt;/li&gt;
&lt;li&gt;So first here are few &lt;em&gt;container&lt;/em&gt; properties for flex.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;display&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XXtI5-yt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/14hibvm6ipue0tft2iqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XXtI5-yt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/14hibvm6ipue0tft2iqf.png" alt="Image description" width="880" height="126"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
   display: flex;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The green background shown in the above image is the main flex container to which the display property of flex is given. It will laid down its children directly.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;flex-direction&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The default property for flex-direction is row. As shown in first example itself&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  // possible values
  flex-direction: row/column/row-reverse/column-reverse;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uDnU-nqa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hp9852gmxetuowbzwsxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uDnU-nqa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hp9852gmxetuowbzwsxx.png" alt="Image description" width="880" height="103"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VaamZvsP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7z29v2vd6ihu3pthhose.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VaamZvsP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7z29v2vd6ihu3pthhose.png" alt="Image description" width="880" height="109"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ojq1m2ID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecmccl0aeublqdz4wql1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ojq1m2ID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecmccl0aeublqdz4wql1.png" alt="Image description" width="880" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The flex-direction property will set the main-axis &amp;amp; items are aligned according to the value of direction.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;flex-wrap&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The default value is "no-wrap" means items will tend to fit itself into a single row or column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  // possible values
  flex-wrap: no-wrap / wrap / wrap-reverse
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;As it's understood from the image the items are squeezed &amp;amp; tend to align &amp;amp; fit themselves into a single row because of default property of "no-wrap".&lt;/p&gt;

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

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

&lt;p&gt;So by setting &lt;em&gt;flex-wrap&lt;/em&gt; property with its value as &lt;em&gt;wrap&lt;/em&gt; the items are allowed to fit as much available space to them &amp;amp; it will go to next line since wrapping is allowed it will wrap to multiple lines from top to bottom.&lt;/p&gt;

&lt;p&gt;By setting it as &lt;em&gt;wrap-reverse&lt;/em&gt; it behaves similar to wrap but in opposite direction i.e bottom to top. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;justify-content&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This property set alignment along main-axis.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  // possible values
  justify-content: flex-start / flex-end / space-around / space- 
  between / center / space-evenly.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

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

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

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

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

&lt;ul&gt;
&lt;li&gt;flex-start: it is default value items are laid towards starting of flex-direction.&lt;/li&gt;
&lt;li&gt;flex-end: items are laid towards end of flex-direction.&lt;/li&gt;
&lt;li&gt;center: items are placed at the center.&lt;/li&gt;
&lt;li&gt;space-around: items laid down &amp;amp; have equal spaced around them.&lt;/li&gt;
&lt;li&gt;space-between: there is only space between the items of container &amp;amp; not between the borders of container &amp;amp; the items.&lt;/li&gt;
&lt;li&gt;space-evenly: items are equally spaced around the edges &amp;amp; between themselves also.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;align-items&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;It sets out alignment along the cross-axis.&lt;/p&gt;

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

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

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  // possible values
  align-items: center / flex-start / flex-end / baseline / stretch
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So these are the properties which needs to be used on parent for the flex. You can play around with the given sandbox &amp;amp; learn by changing the values for the above listed properties because &lt;em&gt;learning while making is best practice&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/nervous-bassi-ckrh4x?file=/src/styles.css"&gt;https://codesandbox.io/s/nervous-bassi-ckrh4x?file=/src/styles.css&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PS: Feedback's are welcome!! Catch you next time !!!&lt;/p&gt;

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