<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Isurindi Manimendra on Medium]]></title>
        <description><![CDATA[Stories by Isurindi Manimendra on Medium]]></description>
        <link>https://medium.com/@isurindinawodanee?source=rss-598219d0294d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BclNSNTX_LE0K-AJr8xefQ.jpeg</url>
            <title>Stories by Isurindi Manimendra on Medium</title>
            <link>https://medium.com/@isurindinawodanee?source=rss-598219d0294d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:43:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@isurindinawodanee/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic GIT commands ]]></title>
            <link>https://medium.com/linkit-intecs/basic-git-commands-48ba0aff20b7?source=rss-598219d0294d------2</link>
            <guid isPermaLink="false">https://medium.com/p/48ba0aff20b7</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git-basics]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Isurindi Manimendra]]></dc:creator>
            <pubDate>Sun, 23 Jan 2022 18:38:02 GMT</pubDate>
            <atom:updated>2022-02-10T17:51:17.447Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Basics to Advanced — Part II</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zO5GC_wdGUDuOb6R-IelA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Roman Synkevych</a> on <a href="https://unsplash.com/s/photos/github?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>From the last article </strong><a href="https://isurindinawodanee.medium.com/db03df7866ac"><strong>Introduction to GIT 👨‍💻👩‍💻From Basics to Advanced | Part 1</strong></a><strong>, we have discussed what is Git and some introductory facts about Git.</strong></p><p><strong>In this article, let&#39;s see the Basic Commands of Git…</strong></p><p>First, I have created a simple HTML file with the name<em> first.html</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70add3fe15d4da3dd062bdd285212591/href">https://medium.com/media/70add3fe15d4da3dd062bdd285212591/href</a></iframe><p>and created another file as <em>style.css </em>with the following code</p><p>h1 {<br> color: red;<br> text-align: center;<br> margin-top: 20%;<br>}</p><p>Let&#39;s use these two files for our demonstrations.</p><p>Follow me...</p><p>We can do changes to these files and learn Git.</p><h4>Adding files to the “Staging area”</h4><p>The staging area is the place where which holds the files that should be committed. We send our files to the staging area after we have done a task and when we need to store them in the online repository.</p><p>There are 2 methods.</p><ol><li><strong>Adding files one by one to the staging area</strong></li></ol><p><strong>git add &lt;filename.extension&gt;</strong></p><p>Here we provide the file name with the extension which should be added to the staging area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*jQpVRWmZmPV2Z3wcDJMNjg.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p><strong>2. Adding multiple files at once</strong></p><p><strong>2.1</strong> <strong>Adding multiple files which have same extension</strong></p><p><strong>git add *.html</strong></p><p>Using this method we can add the files to the staging area which has same Extention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*2_jJcXa2ZB9_Ko9jStzqQQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p><strong>2.2</strong> <strong>Adding multiple files without considering the extension</strong></p><p><strong>git add .</strong></p><p>We can add all the files at once without considering extensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*Ox8hWw2FUu0zGs1RaOC0WQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Removing files from “Staging area” — unstage a staged file</h4><p>We can add as well as we can remove staged files.</p><p><strong>git rm --cached &lt;filename.extension&gt;</strong></p><p>OR</p><p><strong>git restore --staged &lt;filename.extension&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*1LzHYz5Uu3XpyNU6aJKuhw.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Track staged area — Check status</h4><p>Using this process we are going to track the files which are in the staged area and which are still not in the staged area.</p><ul><li>It shows tracked files in green color and untracked files in red color.</li></ul><p><strong>git status</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*_10Hgb1I537h1H5f2AQa7A.jpeg" /><figcaption>Screenshot by author</figcaption></figure><ul><li>In the figure given above, as we have added the <em>first.html</em> file to the staged area, it is shown as a tracked file (in green color) that is to be committed.</li><li>The <em>style.css</em> file is shown as an untracked file (in red color) as we didn&#39;t add it to the staged area.</li></ul><p>👉 If we do any changes to a staged file in the IDE and see the status, it will show that the file is modified and indicated in red color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*zgtDaqr0zxYA-hsqtpDkoQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Here, I have done a small change to the file <em>first.html</em> and see git status. Then it shows that the file is modified.</p><ul><li>So we can do a git add . and make all the files added to the staged area.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*2SNQ5eU-UVNvr_nYc_9G5A.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Now we have to do commits.</p><h3>Commit a file</h3><p>Committing is saving changes.</p><p>git commit -m ‘&lt;meaningfull commit message’&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*26_00sHkYODHOp8rQjgM-g.jpeg" /><figcaption>Screenshot by author</figcaption></figure><ul><li>Here before commit, when we check git status, it says <em>first.html</em> and <em>style.css</em> files are in the staged area and should be committed.</li><li>After committing, as all the files are committed we can see the working tree clean message appears. (yellow color box)</li></ul><h3>.gitignore file</h3><p>This is very important to know when we store our repositories with massive packages and dependencies such as <em>node_modules</em>.</p><p>It is a file that contains the list of filenames that should not be added to the repository. We include the location of the relevant file which should be ignored when pushing to the repo.</p><p>Eg: notes, logs, temporary files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*WUaZMz6d00egIuvIb1netQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Here I have created a temporary file as <em>temp.txt</em> and included it in the <em>.gitignore</em> file. <strong>When we push our files to the online repository, the files in <em>.gitignore</em> will be ignored.</strong></p><h3>Branching in GIT</h3><p>We use branches to keep our project handling easy and smart. We are initially in the “master” branch. It is the default branch.</p><h4>Creating a branch</h4><p>git branch &lt;branch name&gt;</p><p>for <em>&lt;branch name&gt;</em> you can provide any suitable name.</p><p>After creating a new branch, we are still in the master branch. So we need to switch to the newly created branch.</p><h4>Switching to a branch</h4><p>git checkout &lt;branch name&gt;</p><ul><li>In the below figure, I have created a new branch as “login” and switched to a new branch.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*WDCMnWKGsvcMpbLVTTphzg.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>📌 Important → You must know that we cant see branches although we create them. They are created logically. When we create folders or files under a particular branch, we can just see them as a single collection. But internally, they are grouped under branches.</p><h4>Merging branches</h4><p>When we create projects we have to create several branches and later at the final stage, we need to connect all the parts together in order to get the final project. So, <strong>we need to merge all branches with the master branch</strong>.</p><p>git merge &lt;branch name&gt;</p><h4>Deleting a branch</h4><p>To delete a branch we have to switch to the main branch and then perform the deletion.</p><p>git branch -d &lt;branch name&gt;</p><h3>Git push</h3><p>After creating files and committing, we have done it all in our local machine. So we need to host it in an online repository like Github.com.</p><p>In the first article “ <a href="https://medium.com/p/db03df7866ac/edit?source=your_stories_page----------------------------------------">Introduction to GIT 👨‍💻👩‍💻From Basics to Advanced | Part </a>1”, I have created a new repo named <em>GitBasicsDemo</em> and now I am going to push files to that repo.<br>git remote add origin &lt;repository url&gt;<br> git push -u origin main</p><p>Note: The <em>&lt;repository url&gt;</em> will be provided when creating the repository on the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*md53kheb1umpqvRcsEQ8Lg.jpeg" /></figure><p>Here we set the remote repository URL and then do push to the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*CFsRSDNmwF9TaUQe9ZRscg.jpeg" /></figure><p>It will give some result sentences by sending our files to the remote repository as shown below. ( Screenshot of GitHub repo we created before).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQalt-M1Sm3skGIlCUuJUg.jpeg" /><figcaption>Screenshot by Author</figcaption></figure><p>Now you can see our created files are hosted in the online repository.</p><p>These are too easy. Try them yourself! 😉</p><p>📌 Note: If we have pushed once within the process by giving URL and origin master, we do not need to do it again and again. We can use only, git push .</p><h3>Cloning GitHub Repository</h3><p>Cloning means getting a copy of the existing repository to our local machine. For that, there are some steps to follow.</p><p>Step 1: Go to the place/folder where the clone should be placed</p><p>Step 2: Right-click and open Git Bash there.</p><p>Step 3: Go to GitHub and copy clone URL</p><p>Step 4: In GitBash, git clone &lt;clone url&gt; paste the copied URL and hit enter.</p><p>Now you can see all the files have arrived at your local machine as seen in the online repository.</p><h4>Update the cloned repository</h4><p>You might face some troubles when the original repo has been updated and you are not up-to-date. So you also have to e updated.</p><p>For that, use git pull and press enter.</p><p>Now, you have the updated folder structure which is extremely similar to the online repository.🤗</p><p>Cheers! 🎈 🏆 🎯</p><p>We have done it.</p><blockquote>So, these are the<strong> basic Git commands</strong> you have to know when using git. Although they are<strong> Basic</strong>, these will make you much comfortable when dealing with large projects with multiple contributors.</blockquote><p>See you soon in my next article with a new topic. 💗</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48ba0aff20b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/linkit-intecs/basic-git-commands-48ba0aff20b7">Basic GIT commands 🐾</a> was originally published in <a href="https://medium.com/linkit-intecs">LinkIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to GIT ‍‍]]></title>
            <link>https://medium.com/linkit-intecs/introduction-to-git-db03df7866ac?source=rss-598219d0294d------2</link>
            <guid isPermaLink="false">https://medium.com/p/db03df7866ac</guid>
            <category><![CDATA[basic-git-commands]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Isurindi Manimendra]]></dc:creator>
            <pubDate>Sun, 23 Jan 2022 18:34:48 GMT</pubDate>
            <atom:updated>2022-02-04T09:54:21.654Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Basics to Advanced | Part I</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Q0T2W2qy1wDxBhR" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>You will often hear the phrase “GIT” in the tech world. The reason is that it is one of the main requirements of modern software engineers.</h4><p>So, let’s learn git, from the beginning to advanced, the things that you must know in GIT.</p><h3>What is Git?</h3><p>Git is a free open-source version control software. It was created by Linus Torvalds in 2005. This tool is a version control system that was initially developed to work with several developers on the Linux kernel.</p><p>🔆 This means that Git is a content tracker. So git can be used to store content and it is mostly used to store code because of the other features it provides.</p><h4>Main <em>advantages</em> of using a version control system…</h4><p>1. You know guys, real-world projects generally have multiple developers working in parallel. So they need a version control system like git to make sure that there are no code conflicts between them.</p><p>2. And also, the requirements of those projects change very often. So a version control system allows developers to revert and go back to an older version of their code and do further developments.</p><p>3. The branch system in Git allows developers to work individually on a task. For example, one branch → one task → one developer</p><p>4. Further, it helps to showcase your work done on the project</p><h4>What is a GIT Repository?</h4><blockquote>A <strong>repository</strong> or “<strong>repo</strong>” is a project that contains multiple files. In our case, it is a collection of code-based files.</blockquote><p>If we want to start using git, we need to know where we are going to host our repositories. There are 2 ways of hosting git repositories,</p><p>1. Online hosting — We host our repositories on the cloud</p><p>2. Offline — Self-installed on your server</p><p>🔆 When choosing an online hosting method, there are 3 popular hosting platforms such as <a href="https://github.com/">GitHub</a>, <a href="https://gitlab.com/">GitLab</a>, and <a href="https://bitbucket.org/">Bit bucket</a>. So you can select one of these to host your repo.</p><p>** I will use GitHub as my hosting platform for demonstrating purposes in this article.</p><h3>Creating a new repository</h3><p>Before starting work, we need to create a repository after registering in GitHub.</p><p>Steps:</p><p>1. Go to + mark or new repository icon( As shown in the figure given)</p><p>2. Select “new repository”</p><p>3. Give proper name, description, and other details for your repository</p><p>4. Create your repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzLWJo4jy1UnbWYfquV8ZA.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Then we have to download Git Bash to our local machine. Here I have given you the link.</p><p><a href="https://git-scm.com/download/win">https://git-scm.com/download/win</a></p><p>Go to this link and install Git bash to your local machine. If it has been installed properly when you right-click on a free area, the refresh menu will show “Git GUI Here” and “Git Bash Here” options.</p><p>Now we can use Git Bash for our works. So let’s begin…👏👏👏</p><h4>Create a folder using Git Bash</h4><p>1. Right-click on the place where the project folder should be created</p><p>2. Click on “Git Bash Here”.</p><p>3. Then new terminal will open and type mkdir &lt;name&gt; and then press Enter.</p><p>(replace the name of your folder on &lt;name&gt; )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*WuvWxXwRdEo2SkdqUBvy1g.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Check the folders and documents in the current location</h4><p>Type ls and press enter. Then it will show all the available documents and folders in the place you are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*s548nm7SkhRXeWvDwXzZaQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Clear the terminal</h4><p>Type clearand press Enter. Then it will clear the terminal and give you clean space to type commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*d038E6u2ejGejdIg1ZWmsA.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Go to the folder we created</h4><p>Type cd &lt;name&gt; .Here you can type the name of the folder on the space &lt;name&gt; to which you need to navigate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*r5CUrCxeHh2RzFAO3JXd-g.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>Create a file within a folder</h4><p>Type touch &lt;filename&gt; and press Enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*ZaBtHKy1yPLvpoJfI49UVw.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>In the above figure, Index refers to the name of the file and .html refers to the extension. You can change them according to the purpose.</p><h4>Open your IDE using the Git bash terminal</h4><p>1. For Visual Studio Code IDE, Type code .</p><p>2. For Atom IDE, Type atom .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*PLfMdSGBBwtFbEfu91G-1Q.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Then it will automatically open the IDE in the relevant folder for you</p><p><strong>We have to initialize git to the local repository and then deploy it to GitHub.To initialize git in a local repo,</strong></p><p>Type git init and press enter.</p><p>Now git has initiated for our folder and we are in the “master” branch of our local repository. (You can see it from the screenshot given)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*uvhsaKDF3Yd59DG2kDQdew.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>📌 Note: As a beginner, you will be needed to provide the username and email of your GitHub account to the git repository.</p><p>1. Type git config — -global user.name ‘username’ and press Enter</p><p>2. Type git config — -global user.email ‘useremail’ and press Enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*anPFPo40XK7oOJwqyOD3_g.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Up to this point, we have configured git to our local repository and now we are ready to work with the online repository.</p><p>So guys there is a lot to learn; Staging files, Committing, push, pull, clone and many more to know about git.</p><p>We will learn about them in my next article: <a href="https://isurindinawodanee.medium.com/48ba0aff20b7?source=friends_link&amp;sk=4158d8f1bd34038e3fed9451eb6d0559">Basic GIT commands 🐾 From Basics to Advanced for beginners — Part II</a></p><p>See you soon…💖</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db03df7866ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/linkit-intecs/introduction-to-git-db03df7866ac">Introduction to GIT 👨‍💻👩‍💻</a> was originally published in <a href="https://medium.com/linkit-intecs">LinkIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flexbox Properties…]]></title>
            <link>https://medium.com/linkit-intecs/flexbox-properties-4ba5ab7236e7?source=rss-598219d0294d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ba5ab7236e7</guid>
            <category><![CDATA[flexboxlayout]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[html-and-css]]></category>
            <category><![CDATA[flex-grow]]></category>
            <category><![CDATA[flexbox]]></category>
            <dc:creator><![CDATA[Isurindi Manimendra]]></dc:creator>
            <pubDate>Tue, 23 Feb 2021 03:51:32 GMT</pubDate>
            <atom:updated>2021-03-16T02:21:12.085Z</atom:updated>
            <content:encoded><![CDATA[<h4>Continued from the article “<a href="https://medium.com/linkit-intecs/flex-boxes-in-css-f6c1be88cab1?source=collection_detail----17c876fce061-----0-----------------------">Flexboxes in CSS</a>” 🙃</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*cOnpWc_EhTfyc10vYjRbVw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@shiqyun?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Helen Shi</a> on <a href="https://unsplash.com/s/photos/flex-box?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>There are 6 main properties in the flexbox element</h4><ol><li>Flexbox-grow</li><li>Flexbox-shrink</li><li>Flexbox-wrap</li><li>Flexbox-direction</li><li>Flexbox-basis</li><li>Flexbox-flow</li></ol><p>In this article, we are going to discuss the first three of the above list.</p><p>Here we go…</p><h3>1. Flex grow property</h3><p>In the last article, I have demonstrated the basics of flexbox. So there you can see that much space is left in the container.</p><p>That’s not the appropriate way.</p><p>So let’s grow these elements to get that remaining space in the container.</p><p>We can do it using the “<strong>flex-grow</strong> “property.</p><p>Here all we have to do is come to the <strong><em>.box</em></strong> in the CSS file and say flex-grow and set it is equal to 1.</p><pre>.<em>box</em>{<br>  height:100px;<br>  min-width: 100px;<br>  flex-grow: 1;<br>}</pre><p>Now, what happens is each element is growing at a rate of 1 and that all grow and get the same rate to take up all the available room in the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NCZc7DSVciojTXdf_baqmA.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>If we set 100, it would also give the same output. The reason for that is because this is like a growth rate and here we have given all the boxes the same growth rate. So they are all growing to the same dimensions.</p><p><em>If we remove the flex-grow from .box and give flex-grow to the elements individually it gives a different flex core grow.</em></p><pre>.<em>box</em>{<br>  height:100px;<br>  min-width: 100px;<br>}</pre><pre>.<em>one</em>{<br>  background-color: rgb(220, 139, 231);<br>  flex-grow: 1;<br>}</pre><pre>.<em>two</em>{<br>  background-color: rgb(219, 103, 213);<br>  flex-grow: 2;<br>}</pre><pre>.<em>three</em>{<br>  background-color: rgb(113, 0, 128);<br>  flex-grow: 3;<br>}</pre><p>Here it goes in the browser…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEH0ELCuwo0nXc16eC88UQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>We use flex-grow to expand elements into available space and the rate at which it expands into that space is governed by the number we are given, when we give different rates it reaches different widths.</p><h3>2. Flex-shrink</h3><p>This is the opposite of flex growth.</p><p>Here instead of determining the rate at which they grow, we are going to rate at which they shrink as the browser gets small.</p><p>And by the way, these flex items these all going to shrink in proportion to one another at the same rate.</p><p>When we set flex-shrink to 1, It shrinks each element in the same proportion.</p><pre>.<em>box</em>{<br>  height:100px;<br>  flex-grow: 1;<br>  flex-shrink: 1;<br>}</pre><p>The browser displays it like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*WtDQGc2-7E0MALGDh_Ymiw.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p><em>So, we can set different rates to each flex-shrink property on each of these items to shrink them at different rates.</em></p><pre>.<em>box</em>{<br>  height:100px;<br>  width:320px;<br>  }</pre><pre>.<em>one</em>{<br>  background-color: rgb(220, 139, 231);<br>  flex-shrink: 1;<br>}</pre><pre>.<em>two</em>{<br>  background-color: rgb(219, 103, 213);<br>  flex-shrink: 4;<br>}</pre><pre>.<em>three</em>{<br>  background-color: rgb(113, 0, 128);<br>  flex-shrink: 8;<br>}</pre><p>As the browser gets smaller it starts to shrink at different rates. Element “Three” has the highest shrink rate. So it shrinks comparatively more when the browser shrinks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*R5D502UCHwrttXKiecshAA.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h3>3. Flex-wrap</h3><p>This is the default behavior of flex.</p><p>If the element reaches a point where it no longer shrinks any further, as we have specified minimum width. So, it goes off the web page.</p><p>So that’s where flex-wrap comes in to play.</p><p>When you reach your minimum width Instead of going off-page, wrap to the next line and take all the available space there instead.</p><p>Steps.., so go to the container, and we apply the flex-wrap property to control the wrapping of those elements.</p><pre>.<em>flex-container</em>{<br>  display: flex;<br>  flex-wrap: wrap;<br>}</pre><pre>.<em>box</em>{<br>  height:100px;<br>  min-width:200px;<br>  flex-grow: 1;<br>}</pre><p>So, now when we shrink it beyond the min-width, the element will wrap to the next line who has no enough space in the line.</p><p>See the flex-wrap in the browser…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*lnk2Cv5a8V2h6YJBXGnZ5g.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>We can have different values for this property as <em>flex-wrap: reverse;</em> or flex-<em>wrap:nowrap;</em></p><h4>💡 Flex-wrap : wrap-reverse;</h4><p>That is going to do a plan of the opposite of wrap. Instead of coming to the next line, it goes to the above line.</p><pre>.<em>flex-container</em>{<br>  display: flex;<br>  flex-wrap: wrap-reverse;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*TXkHj8LQ54uPrIykJNGHhw.jpeg" /><figcaption>Screenshot by author</figcaption></figure><h4>💡 Flex-wrap:nowrap;</h4><p>This is the default behavior, it just like we don’t have this property at all, so we have to scroll to see the rest.</p><pre>.<em>flex-container</em>{<br>  display: flex;<br>  flex-wrap: nowrap;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*xhzCevZ8o0ibii63rXcoAg.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>I think these properties will be very useful for you in responsive web development. So the next three properties will be discussed in the next article.</p><p>So, Readers, give a clap and stay tuned…🙃</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ba5ab7236e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/linkit-intecs/flexbox-properties-4ba5ab7236e7">Flexbox Properties…</a> was originally published in <a href="https://medium.com/linkit-intecs">LinkIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flex Boxes in CSS...]]></title>
            <link>https://medium.com/linkit-intecs/flex-boxes-in-css-f6c1be88cab1?source=rss-598219d0294d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6c1be88cab1</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[flexboxlayout]]></category>
            <category><![CDATA[html-and-css]]></category>
            <category><![CDATA[css-flexbox]]></category>
            <category><![CDATA[flexbox]]></category>
            <dc:creator><![CDATA[Isurindi Manimendra]]></dc:creator>
            <pubDate>Tue, 23 Feb 2021 03:45:04 GMT</pubDate>
            <atom:updated>2021-03-05T09:01:29.191Z</atom:updated>
            <content:encoded><![CDATA[<p>Basic Introduction of what flex boxes are and their containers. ✌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQmarw_amkx040XjXVcglA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@imamulki?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Imam Mulia Bahri</a> on <a href="https://unsplash.com/s/photos/flex-box?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4><em>Let’s talk about how to layout a webpage using flex boxes step by step.</em></h4><p>When we creating a webpage, we typically use different positional properties such as position, absolute or relative, to get elements exactly where we want them on the web page. Sometimes we use things like floats for creating grid layouts or navigation systems and also we would probably use things like fixed heights for columns that we want to be equal in height.</p><p>But then, we will face the problem of collapsing elements and there we have to come up with a clear fix to overcome it. That is also a messy thing.</p><p>So this is where “<strong>CSS FlexBox</strong>” comes in….</p><p>Let’s see what a flexbox is…🧐</p><p>Flexbox is just a new CSS display type that is designed to help us craft those CSS layouts much easier.</p><p>So, it lets us control the position of elements, their size, and the spacing relative to their parent container elements and each other. Especially it works great responsively too.</p><p>So here is a kind of quick overview of how flexbox works.</p><p>First of all, what we do is take a container like this, and then we would apply a display type of flex to the parent element. Then those children elements directly become flexible as they are included in a parent element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*JQG0tyGRr0IxLa8o7Cehvw.jpeg" /><figcaption>Image by author</figcaption></figure><p><em>That means we can control how they shrink and how they grow within it and as well as the spacing between them.</em></p><h4>There are some benefits of using flexbox in web pages…</h4><p>1. Navigation bars and menus</p><p>2. Grid layouts</p><p>3. Bar charts</p><p>4. Equal height Columns</p><p>❗❗❗ It is important to mention that the flexbox is not fully supported for every browser. But most of the browsers are supported. Internet Explorer has many problems with flexboxes. But most popular browsers like Chrome work well with flex boxes.</p><p><strong>Tip-: </strong>If you are going to use flexbox in your webpage, then you need to provide back options for those browsers which don’t support the browser</p><p>One way is modernizer, it is a cool JavaScript library, and basically, just it detects which browser the user is viewing your website. So the modernizer adds a class into the body tag on your webpage then we can use that class to create specific styles in CSS.</p><h3>Flexbox containers</h3><p>First, we have to create a container- an element with a display type of flex.</p><p>So, every direct descendant element within it then become a flex item, so once we have done we can control the behavior of those flex items using several flexbox CSS properties that are applied to the items themselves or the container.</p><p>And that behavior includes things like how they grow within the container or how they shrink relative to each other or whether they stack on each other or side by side</p><p>So let’s move to create a flexbox in the webpage. 😎</p><p>Here, I use the VS Code and two documents as index.html and style.css. The CSS file is linked to this HTML file.</p><p>Then In the body, we just got a <strong>class of wrapper</strong> on a <strong>div</strong> tag which is going to keep everything within in a central column on the page.</p><p>So, In index.html I’m going to create an element that will be called our flex container. I will make a div tag and give a class of “<strong>flex-container</strong>”. That’s our container.</p><p>So within that now we need to contain some flex items. Open another div and give a class of “box” and copy and paste them to get different boxes to style them differently. So now we have our container there and flex items within it.</p><pre>&lt;!DOCTYPE <em>html</em>&gt;<br>&lt;html <em>lang</em>=&quot;en&quot;&gt;<br> &lt;head&gt;<br>    &lt;title&gt;The CSS Flexbox&lt;/title&gt;<br>    &lt;link <em>rel</em>=&quot;stylesheet&quot; <em>type</em>=&quot;text/css&quot; <em>href</em>=&quot;style.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div <em>class</em>=&quot;wrapper&quot;&gt;<br>    &lt;div <em>class</em>=&quot;flex-container&quot;&gt;<br>       &lt;div <em>class</em>=&quot;box one&quot;&gt;&lt;/div&gt;<br>       &lt;div <em>class</em>=&quot;box two&quot;&gt;&lt;/div&gt;<br>       &lt;div <em>class</em>=&quot;box three&quot;&gt;&lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>We need to design a box element.</p><p>So, in style.css, every single one of the boxes is going to have a height of 100px and a min-width value of 100px. And we will give different backgrounds to each box.</p><pre>*{<br>  font-family: verdana;<br>  margin: 0;<br>}</pre><pre>body{<br>  background: #eee;<br>}</pre><pre>.<em>wrapper</em>{<br>  width: 100%;<br>  max-width: 960px;<br>  margin: 0 auto;<br>}</pre><pre>.<em>box</em>{<br>  height:100px;<br>  min-width: 100px;<br>}</pre><pre>.<em>one</em>{<br>  background-color: rgb(220, 139, 231); <br>}</pre><pre>.<em>two</em>{<br>  background-color: rgb(219, 103, 213);<br>}</pre><pre>.<em>three</em>{<br>  background-color: rgb(113, 0, 128);<br>}</pre><p>Here it appears like this in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pCRglbivCLBbOBSFTZ5Xg.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>You noticed that each one of these elements right here is going full width and that’s the default behavior of block-level elements, they take off the full width of the available room horizontally.</p><p>To overcome it, we need to add a display type of <strong>flex</strong> to the CSS doc.</p><p>So we say .flex-container; that’s the element we want, and we give this <em>display of flex </em>in CSS document.</p><pre>.<em>flex-container</em>{<br>  display: flex;<br>}</pre><p>Now all of these become the flex items and this is the default behavior of flex items. That they stack left to right in a row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pT8GNBqDXeG3pw7cd3gREQ.jpeg" /><figcaption>Screenshot by author</figcaption></figure><p>Once we make this container we can put elements within it, then we can control the flexibility.</p><p>Fine…</p><p>It’s important to know that, as other CSS tools Flexbox also has several functionalities like spacing, growth, shrinking, and how they stack. Those are also important to know as a web developer to make a creative website.</p><p>Let’s discuss them in my next article, Flexbox properties.</p><p>So give a clap and stay tuned…😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6c1be88cab1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/linkit-intecs/flex-boxes-in-css-f6c1be88cab1">Flex Boxes in CSS...</a> was originally published in <a href="https://medium.com/linkit-intecs">LinkIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>