<?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"><channel><title><![CDATA[Insights - by Mukul]]></title><description><![CDATA[Insights - by Mukul]]></description><link>https://coder666.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 20:03:47 GMT</lastBuildDate><atom:link href="https://coder666.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Arrays in JavaScript]]></title><description><![CDATA[Arrays if not the important are by far the most pertinent concept that one needs to be aware and definitely master in order to have a solid command over any language. 
What is an Array?
An array is defined as the collection of different items either ...]]></description><link>https://coder666.hashnode.dev/arrays-in-javascript</link><guid isPermaLink="true">https://coder666.hashnode.dev/arrays-in-javascript</guid><category><![CDATA[iwritecode]]></category><category><![CDATA[#iwritecode  #hiteshchoudhary  #LCO  #markdown #git  #github]]></category><category><![CDATA[ineuron]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Sat, 27 Aug 2022 13:07:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1661602442398/RPRm17_QK.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>A</strong>rrays if not the important are by far the most pertinent concept that one needs to be aware and definitely master in order to have a solid command over any language. </p>
<h3 id="heading-what-is-an-array">What is an Array?</h3>
<p><em>An array is defined as the collection of different items either of same or different data types stored at contiguous memory locations.</em></p>
<h3 id="heading-why-an-array">Why an array?</h3>
<p>I am no no judge myself to pass a verdict as to why was array introduced but why not? I mean take a scenario for instance. You are advised to create a telephone recode for <strong>10</strong> persons. Each recode will contain a name, telephone number, address, Pin-Code.</p>
<p>Now if you go on the usual route of declaring variables for each and every thing, you'll end up with more than 50 variables to be accounted for.</p>
<pre><code>let phone1<span class="hljs-operator">=</span><span class="hljs-number">10</span>; 
let name1<span class="hljs-operator">=</span><span class="hljs-string">"Sandra"</span>;
let phone_number1<span class="hljs-operator">=</span>8076XXXXXX;
let pinCode<span class="hljs-operator">=</span><span class="hljs-number">560029</span>
.
.
.
</code></pre><p>However, for an array it's all simple. Declare an array, store all this inside an array and create 10 of them. That's almost half the job solved already.</p>
<pre><code><span class="hljs-attribute">let</span> directory<span class="hljs-number">1</span>=[<span class="hljs-number">10</span>,<span class="hljs-string">"Sandra"</span>,<span class="hljs-number">8076</span>XXXXXXX,<span class="hljs-number">560029</span>];
</code></pre><p><strong>See, everything has a reason.</strong></p>
<p>Also if you want to manipulate an array, you are free to do that as well. You can edit an entry, cut out a portion, whatever comes on top of your mind. 
If you're coming from a programming background, you're already aware of how tough these operations are and the lines of codes that you need to write in. In other languages such as C, C++ for instance, writing a single sorting code, i.e., to sort the elements inside an array you have to write down the entire following code.</p>
<pre><code><span class="hljs-keyword">int</span> a <span class="hljs-operator">=</span>[<span class="hljs-number">160</span>,<span class="hljs-number">80</span>,<span class="hljs-number">10</span>,<span class="hljs-number">20</span>,<span class="hljs-number">40</span>,<span class="hljs-number">90</span>];

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i<span class="hljs-operator">=</span><span class="hljs-number">0</span>;i<span class="hljs-operator">&lt;</span><span class="hljs-number">6</span>;<span class="hljs-operator">+</span><span class="hljs-operator">+</span>i) {
  <span class="hljs-keyword">if</span> (a[i] <span class="hljs-operator">&gt;</span> a[i<span class="hljs-operator">+</span><span class="hljs-number">1</span>])
    {  <span class="hljs-keyword">int</span> j<span class="hljs-operator">=</span>a[i];
        a[i]<span class="hljs-operator">=</span>a[i<span class="hljs-operator">+</span><span class="hljs-number">1</span>];
        a[i<span class="hljs-operator">+</span><span class="hljs-number">1</span>]<span class="hljs-operator">=</span>j;
    }
}
</code></pre><p>This will sort the array. </p>
<blockquote>
<p>a=[10,20,40,80,90,160]</p>
</blockquote>
<p>But you see the amount of code that you had to write. It's not to undermine other languages. However in languages like JavaScript, all you need to type is...</p>
<pre><code><span class="hljs-attribute">let</span> a =[<span class="hljs-number">160</span>,<span class="hljs-number">80</span>,<span class="hljs-number">10</span>,<span class="hljs-number">20</span>,<span class="hljs-number">40</span>,<span class="hljs-number">90</span>];
<span class="hljs-attribute">a</span>.sort();
</code></pre><blockquote>
<p>a=[10,20,40,80,90,160]</p>
</blockquote>
<p>And that's all it takes. Two lines of code.</p>
<p>Let's dive into other such cool functionalities provided in JavaScript.</p>
<h3 id="heading-length-of-array">Length of Array</h3>
<p><strong>Definition</strong>: It allows you to print length of an array</p>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.length</em></p>
</blockquote>
<pre><code>let arr<span class="hljs-operator">=</span>[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>];
console.log(arr.<span class="hljs-built_in">length</span>);

<span class="hljs-comment">//Output : </span>
<span class="hljs-number">6</span>
</code></pre><h3 id="heading-slicing-an-array">Slicing an Array</h3>
<p><strong>Definition</strong>: It allows you to slice an existing array into another array. </p>
<h4 id="heading-changes-the-original-array-no">Changes the original array: <strong>NO</strong></h4>
<p>It takes in two parameters:</p>
<ul>
<li>Starting index - Index or address from where the array is to be sliced.</li>
<li>End index        - [Index-1] or [address-1] till where the array is to be sliced.</li>
</ul>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.slice(startindex,endindex);</em></p>
</blockquote>
<pre><code>let arr<span class="hljs-operator">=</span>[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>];
console.log(arr.slice(<span class="hljs-number">1</span>,<span class="hljs-number">3</span>));

<span class="hljs-comment">//Output : [2,3]</span>
</code></pre><h3 id="heading-splicing-an-array">Splicing an Array</h3>
<p><strong>Definition</strong>: It allows you to modify the existing array</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<p>It takes in two parameters:</p>
<ul>
<li>Index - Position from where to start the modification in the array.</li>
<li>How may to delete - The entered number is the number of elements deleted starting from the index.</li>
<li>Item 1, item 2 - <em>optional</em> Indicates the value to be appended by the user.</li>
</ul>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.splice(index,how many to delete, item 1, item 2);</em></p>
</blockquote>
<pre><code><span class="hljs-string">let</span> <span class="hljs-string">arr=[1,2,3,4,5,6];</span>
<span class="hljs-string">let</span> <span class="hljs-string">arr1=[1,2,3,4,5,6];</span>
<span class="hljs-string">arr.splice(1,0,10,20);</span>
<span class="hljs-string">arr1.splice(1,1,10,20);</span>
<span class="hljs-string">console.log(arr);</span>
<span class="hljs-string">console.log(arr1);</span>

<span class="hljs-string">//Output</span> <span class="hljs-string">:</span> 
[
  <span class="hljs-number">1</span>, <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">2</span>,
  <span class="hljs-number">3</span>,  <span class="hljs-number">4</span>,  <span class="hljs-number">5</span>, <span class="hljs-number">6</span> 
]
[
  <span class="hljs-number">1</span>, <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">3</span>,
  <span class="hljs-number">4</span>,  <span class="hljs-number">5</span>,  <span class="hljs-number">6</span>
]
</code></pre><h3 id="heading-copy-within-an-array">Copy within an array</h3>
<p><strong>Definition</strong>: It allows you to create a copy within an array</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<p>It takes in Three parameters:</p>
<ul>
<li>Index - Position at which the copied section will be replaced.</li>
<li>starting index - Index from where the copy will start.</li>
<li>ending index - index till where the copy is to be done.</li>
</ul>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.copyWithin(index,starting index for copy, ending index till copy);</em></p>
</blockquote>
<pre><code><span class="hljs-string">let</span> <span class="hljs-string">arr=[1,2,3,4,5,6];</span>
<span class="hljs-string">arr.copyWithin(1,3,5);</span>
<span class="hljs-string">console.log(arr);</span>

<span class="hljs-string">//Output</span> <span class="hljs-string">:</span> 
[ <span class="hljs-number">1</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span> ]
</code></pre><h3 id="heading-remove-elements-from-the-beginning">Remove elements from the beginning</h3>
<p><strong>Definition</strong>: It allows you to remove elements one by one from the beginning of the array.</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.shift();</em></p>
</blockquote>
<pre><code>let arr<span class="hljs-operator">=</span>[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>];
arr.shift();
console.log(arr);

<span class="hljs-comment">//Output : </span>
[ <span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span> ]
</code></pre><h3 id="heading-remove-elements-from-the-last">Remove elements from the last</h3>
<p><strong>Definition</strong>: It allows you to remove elements one by one from the end of the array.</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.pop();</em></p>
</blockquote>
<pre><code>let arr<span class="hljs-operator">=</span>[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>];
arr.<span class="hljs-built_in">pop</span>();
console.log(arr);

<span class="hljs-comment">//Output : </span>
[ <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span> ]
</code></pre><h3 id="heading-add-elements-at-the-beginning">Add elements at the beginning</h3>
<p><strong>Definition</strong>: It allows you to add elements one by one from the beginning.</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.unshift(element);</em></p>
</blockquote>
<pre><code><span class="hljs-string">let</span> <span class="hljs-string">arr=[1,2,3,4,5,6];</span>
<span class="hljs-string">arr.unshift(10);</span>
<span class="hljs-string">console.log(arr);</span>

<span class="hljs-string">//Output</span> <span class="hljs-string">:</span> 
[ <span class="hljs-number">10</span>,<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span> ]
</code></pre><h3 id="heading-add-elements-at-the-end">Add elements at the end</h3>
<p><strong>Definition</strong>: It allows you to add elements one by one at the end</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.push(element);</em></p>
</blockquote>
<pre><code><span class="hljs-string">let</span> <span class="hljs-string">arr=[1,2,3,4,5,6];</span>
<span class="hljs-string">arr.push(10);</span>
<span class="hljs-string">console.log(arr);</span>

<span class="hljs-string">//Output</span> <span class="hljs-string">:</span> 
[ <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">10</span> ]
</code></pre><h3 id="heading-reverse-the-elements">Reverse the elements</h3>
<p><strong>Definition</strong>: It allows you to reverse the elements order</p>
<h4 id="heading-changes-the-original-array-yes">Changes the original array: <strong>YES</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.reverse();</em></p>
</blockquote>
<pre><code><span class="hljs-string">let</span> <span class="hljs-string">arr=[1,2,3,4,5,6];</span>
<span class="hljs-string">arr.reverse();</span>
<span class="hljs-string">console.log(arr);</span>

<span class="hljs-string">//Output</span> <span class="hljs-string">:</span> 
[ <span class="hljs-number">6</span>,<span class="hljs-number">5</span>,<span class="hljs-number">4</span>,<span class="hljs-number">3</span>,<span class="hljs-number">2</span>,<span class="hljs-number">1</span> ]
</code></pre><h3 id="heading-array-as-string">Array as String</h3>
<p><strong>Definition</strong>: It allows you to print entire array as string.</p>
<h4 id="heading-changes-the-original-array-no">Changes the original array: <strong>NO</strong></h4>
<h4 id="heading-syntax">Syntax</h4>
<blockquote>
<p><em>array_name.toString();</em></p>
</blockquote>
<pre><code>let arr<span class="hljs-operator">=</span>[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>];
console.log(arr.toString());

<span class="hljs-comment">//Output : </span>
<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>
</code></pre>]]></content:encoded></item><item><title><![CDATA[Unravelling Flex-Box]]></title><description><![CDATA[Flexbox can be overwhelming but a deep understanding makes it handy for making designing web pages faster.
Imagine four elements present in a webpage. These elements are in a vertical top to bottom design in an HTML structure. As a CSS designer, ever...]]></description><link>https://coder666.hashnode.dev/unravelling-flex-box</link><guid isPermaLink="true">https://coder666.hashnode.dev/unravelling-flex-box</guid><category><![CDATA[Learn Code Online]]></category><category><![CDATA[iwritecode]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Fri, 05 Aug 2022 17:22:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1659716333469/YNVHf1Gnk.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4 id="heading-flexbox-can-be-overwhelming-but-a-deep-understanding-makes-it-handy-for-making-designing-web-pages-faster">Flexbox can be overwhelming but a deep understanding makes it handy for making designing web pages faster.</h4>
<p>Imagine four elements present in a webpage. These elements are in a vertical top to bottom design in an HTML structure. As a CSS designer, everyone has trouble aligning them in a horizontal position let's say in a <strong>Navigation Bar</strong>.</p>
<p>Any page in a web browser has two axes: The main axis and a cross axis. For elements placed on the main axis, you want to shift it into a cross axis. <strong>Difficult right?</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659717865429/bDsKiNlXQ.png" alt="image.png" /></p>
<p>Enter, <strong>FLEX-BOX</strong> the new display method, that allows you to do quick work of it. </p>
<h2 id="heading-flex-is-applied-on-the-parent-container-to-align-the-child-elements-in-the-direction-you-want">Flex is applied on the parent container to align the child elements in the direction you want.</h2>
<p>For example: Look at the following snippet of code.</p>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>style<span class="hljs-operator">&gt;</span>
        .parent{
            background<span class="hljs-operator">-</span>color: purple;
        }
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>style<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"parent"</span><span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"obj1"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span>img src<span class="hljs-operator">=</span><span class="hljs-string">"https://learnyst-user-assets.s3.ap-south-1.amazonaws.com/school-assets/schools/2410/schoolLogo/1657573685244Custom%20Size%20%E2%80%93%201.png"</span> alt<span class="hljs-operator">=</span><span class="hljs-string">"logo1"</span> height<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span> width<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"obj2"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span>img src<span class="hljs-operator">=</span><span class="hljs-string">"https://learnyst-user-assets.s3.ap-south-1.amazonaws.com/school-assets/schools/2410/schoolLogo/1657573685244Custom%20Size%20%E2%80%93%201.png"</span> alt<span class="hljs-operator">=</span><span class="hljs-string">"logo1"</span> height<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span> width<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"obj3"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span>img src<span class="hljs-operator">=</span><span class="hljs-string">"https://learnyst-user-assets.s3.ap-south-1.amazonaws.com/school-assets/schools/2410/schoolLogo/1657573685244Custom%20Size%20%E2%80%93%201.png"</span> alt<span class="hljs-operator">=</span><span class="hljs-string">"logo1"</span> height<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span> width<span class="hljs-operator">=</span><span class="hljs-string">"10%"</span><span class="hljs-operator">&gt;</span><span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><p>which gives out the following output...</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659718916205/xUG_dV4NS.png" alt="image.png" />
<a target="_blank" href="https://cdn.hashnode.com/res/hashnode/image/upload/v1659718523723/fpk1CfFF2.png">image.png</a></p>
<p>To align these items on the main axis, all you need to do is apply <strong>flex.</strong> </p>
<pre><code>   <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
        <span class="hljs-selector-class">.parent</span>{
            <span class="hljs-attribute">background-color</span>: purple;
            <span class="hljs-attribute">display</span>: flex;
        }
    </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
</code></pre><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659718973835/136mDMi1t.png" alt="image.png" /></p>
<p>Fairly easy. <strong>Flex</strong>allows you to change the directions of elements easily inside an HTML structure. </p>
<p>Certain facts about FLEX</p>
<p>Flex allows you to change the orientations of elements:</p>
<blockquote>
<h4 id="heading-1-flex-direction-row">1. Flex-direction: Row;</h4>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659719709381/grJq48skO.png" alt="image.png" />
It's a default direction but anyhow if you want you can change what you want.</p>
<blockquote>
<h4 id="heading-2-flex-direction-row-reverse">2. Flex-direction: Row-reverse;</h4>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659719787716/po7479wC_.png" alt="image.png" />
Allows you to reverse the positions of elements in a row but in reverse order.</p>
<blockquote>
<h4 id="heading-3-flex-direction-column">3. Flex-direction: Column;</h4>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659719842587/qywMMs2DQ.png" alt="image.png" />
Allows you to place the elements in a column direction.</p>
<blockquote>
<h4 id="heading-4-flex-direction-column-reverse">4. Flex-direction: Column-reverse;</h4>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1659720048317/TQnPVoNVW.png" alt="image.png" />
Allows you to reverse the positions of elements in a column but in reverse order.</p>
<p>Explore more about flex to design websites in an interesting way. Keep learning.</p>
]]></content:encoded></item><item><title><![CDATA[CSS-Positioning: Move it like you want]]></title><description><![CDATA[What is positioning?
Quite easy to guess from the name itself, positions are used a lot in CSS to describe how elements are placed in a document. It's one of the most used properties in web design. 
They define how elements behave with the top, left,...]]></description><link>https://coder666.hashnode.dev/css-positioning-move-it-like-you-want</link><guid isPermaLink="true">https://coder666.hashnode.dev/css-positioning-move-it-like-you-want</guid><category><![CDATA[Learn Code Online]]></category><category><![CDATA[iwritecode]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Sun, 24 Jul 2022 03:06:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1658630043394/Ka3TOIjae.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-positioning">What is positioning?</h2>
<p>Quite easy to guess from the name itself, positions are used a lot in CSS to describe how elements are placed in a document. It's one of the most used properties in web design. 
They define how elements behave with the <code>top</code>, <code>left</code>, <code>bottom</code>, and <code>right</code> property. 
In CSS, there are five positioning properties namely: <strong>static</strong>, <strong>relative</strong>, <strong>fixed</strong>, <strong>absolute</strong>, and <strong>sticky</strong>. These properties behave in special ways. </p>
<p>Let's get started...</p>
<h2 id="heading-static-positioning">STATIC POSITIONING</h2>
<p>The  <code>static</code> property is the default position value for every element. It can be used to define the position of an element and also to override or hide elements from their normal flow of DOM.</p>
<p>###CODE</p>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>link rel<span class="hljs-operator">=</span><span class="hljs-string">"stylesheet"</span> href<span class="hljs-operator">=</span><span class="hljs-string">"./style.css"</span><span class="hljs-operator">&gt;</span>
  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>

          <span class="hljs-operator">&lt;</span>h2<span class="hljs-operator">&gt;</span>STATIC POSITION<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h2<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"static"</span><span class="hljs-operator">&gt;</span>Position: static;<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><pre><code><span class="hljs-selector-tag">body</span> {
    <span class="hljs-attribute">height</span>: <span class="hljs-number">500px</span>;
}
<span class="hljs-selector-class">.static</span> {
    <span class="hljs-attribute">position</span>: static;
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Courier New'</span>, Courier, monospace;
    <span class="hljs-attribute">background-color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">104</span>, <span class="hljs-number">233</span>, <span class="hljs-number">238</span>);
    <span class="hljs-attribute">height</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">300px</span>;

    <span class="hljs-attribute">text-align</span>: center;
}
</code></pre><h3 id="heading-output">OUTPUT</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658630812074/lp8HmsK9c.png" alt="image.png" /></p>
<h2 id="heading-relative-positioning">RELATIVE POSITIONING</h2>
<p>For relative positioned elements, they retain their order in the document. This means they are bounded by the space they occupy in the document. Relative positioning can be used in combination with <code>fixed</code> and <code>absolute</code> positions.</p>
<h3 id="heading-code">Code</h3>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>link rel<span class="hljs-operator">=</span><span class="hljs-string">"stylesheet"</span> href<span class="hljs-operator">=</span><span class="hljs-string">"./style.css"</span><span class="hljs-operator">&gt;</span>
  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>h2<span class="hljs-operator">&gt;</span>STATIC Relative<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h2<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"static"</span><span class="hljs-operator">&gt;</span>Position: Relative<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><pre><code><span class="hljs-selector-class">.back</span> {
    <span class="hljs-attribute">height</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">background-color</span>: black;
    <span class="hljs-attribute">position</span>: static;
    <span class="hljs-attribute">color</span>: azure;
}
<span class="hljs-selector-class">.static</span> {
    <span class="hljs-attribute">position</span>: relative;
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Courier New'</span>, Courier, monospace;
    <span class="hljs-attribute">background-color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">104</span>, <span class="hljs-number">233</span>, <span class="hljs-number">238</span>);
    <span class="hljs-attribute">height</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">text-align</span>: center;
}
</code></pre><h3 id="heading-output">OUTPUT</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631043586/DF3WVXaNd.png" alt="image.png" /></p>
<h2 id="heading-absolute-positioning">ABSOLUTE POSITIONING</h2>
<p>The absolute positioning lets you specify exactly where you want an element positioned. </p>
<p>The difference between this and the <code>relative</code> position is that:</p>
<ul>
<li>the boundary for absolute elements is different.</li>
<li>absolute elements are removed from the flow of the document.</li>
</ul>
<p>###Code</p>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>link rel<span class="hljs-operator">=</span><span class="hljs-string">"stylesheet"</span> href<span class="hljs-operator">=</span><span class="hljs-string">"./style.css"</span><span class="hljs-operator">&gt;</span>
  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>h2<span class="hljs-operator">&gt;</span>ABSOLUTE<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h2<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"static"</span><span class="hljs-operator">&gt;</span>Position: ABSOLUTE<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><pre><code><span class="hljs-selector-class">.back</span> {
    <span class="hljs-attribute">height</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">background-color</span>: black;
    <span class="hljs-attribute">color</span>: azure;
}
<span class="hljs-selector-class">.static</span> {
    <span class="hljs-attribute">position</span>: absolute;
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Courier New'</span>, Courier, monospace;
    <span class="hljs-attribute">background-color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">104</span>, <span class="hljs-number">233</span>, <span class="hljs-number">238</span>);
    <span class="hljs-attribute">height</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">0px</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">0px</span>;

    <span class="hljs-attribute">text-align</span>: center;
}
</code></pre><h3 id="heading-output">OUTPUT</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631444181/kdHBWfH11.png" alt="image.png" /></p>
<h2 id="heading-fixed-positioning">FIXED POSITIONING</h2>
<p>Fixed positioned elements are similar to absolute elements. They are removed from the flow of the document but contrary to the latter, they do not respect relative parents as boundaries.</p>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>link rel<span class="hljs-operator">=</span><span class="hljs-string">"stylesheet"</span> href<span class="hljs-operator">=</span><span class="hljs-string">"./style.css"</span><span class="hljs-operator">&gt;</span>
  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>h2<span class="hljs-operator">&gt;</span>FIXED<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h2<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"static"</span><span class="hljs-operator">&gt;</span>Position: FIXED<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back1"</span><span class="hljs-operator">&gt;</span>hello<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><pre><code><span class="hljs-selector-class">.back</span> {
    <span class="hljs-attribute">height</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">background-color</span>: black;
    <span class="hljs-attribute">color</span>: azure;
}
<span class="hljs-selector-class">.static</span> {
    <span class="hljs-attribute">position</span>: fixed;
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Courier New'</span>, Courier, monospace;
    <span class="hljs-attribute">background-color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">104</span>, <span class="hljs-number">233</span>, <span class="hljs-number">238</span>);
    <span class="hljs-attribute">height</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">0px</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">0px</span>;

    <span class="hljs-attribute">text-align</span>: center;
}

<span class="hljs-selector-class">.back1</span>{
    <span class="hljs-attribute">position</span>: relative;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">2000px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">2000px</span>;
    <span class="hljs-attribute">background-color</span>: green;
}
</code></pre><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631703066/bKbg244-6.png" alt="image.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631733334/lpKDmqpqu.png" alt="image.png" /></p>
<h2 id="heading-sticky-positioning">STICKY POSITIONING</h2>
<p>The sticky is a new CSS position property that lets you make an element stay in the same place on the page even when the page is scrolled. </p>
<p>#Code</p>
<pre><code><span class="hljs-operator">&lt;</span><span class="hljs-operator">!</span>DOCTYPE html<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>html lang<span class="hljs-operator">=</span><span class="hljs-string">"en"</span><span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>head<span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta charset<span class="hljs-operator">=</span><span class="hljs-string">"UTF-8"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta http<span class="hljs-operator">-</span>equiv<span class="hljs-operator">=</span><span class="hljs-string">"X-UA-Compatible"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"IE=edge"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>meta name<span class="hljs-operator">=</span><span class="hljs-string">"viewport"</span> content<span class="hljs-operator">=</span><span class="hljs-string">"width=device-width, initial-scale=1.0"</span><span class="hljs-operator">&gt;</span>
    <span class="hljs-operator">&lt;</span>title<span class="hljs-operator">&gt;</span>Document<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>title<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>link rel<span class="hljs-operator">=</span><span class="hljs-string">"stylesheet"</span> href<span class="hljs-operator">=</span><span class="hljs-string">"./style.css"</span><span class="hljs-operator">&gt;</span>
  <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>head<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span>body<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back"</span><span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>h2<span class="hljs-operator">&gt;</span>STICKY<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>h2<span class="hljs-operator">&gt;</span>
          <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"static"</span><span class="hljs-operator">&gt;</span>Position: Sticky<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
        <span class="hljs-operator">&lt;</span>div class<span class="hljs-operator">=</span><span class="hljs-string">"back1"</span><span class="hljs-operator">&gt;</span>hello<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>body<span class="hljs-operator">&gt;</span>
<span class="hljs-operator">&lt;</span><span class="hljs-operator">/</span>html<span class="hljs-operator">&gt;</span>
</code></pre><pre><code><span class="hljs-selector-class">.back</span> {
    <span class="hljs-attribute">height</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">500px</span>;
    <span class="hljs-attribute">background-color</span>: black;
    <span class="hljs-attribute">color</span>: azure;
}
<span class="hljs-selector-class">.static</span> {
    <span class="hljs-attribute">position</span>: Sticky;
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Courier New'</span>, Courier, monospace;
    <span class="hljs-attribute">background-color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">104</span>, <span class="hljs-number">233</span>, <span class="hljs-number">238</span>);
    <span class="hljs-attribute">height</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">0px</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">0px</span>;

    <span class="hljs-attribute">text-align</span>: center;
}

<span class="hljs-selector-class">.back1</span>{
    <span class="hljs-attribute">position</span>: relative;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">2000px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">2000px</span>;
    <span class="hljs-attribute">background-color</span>: green;
}
</code></pre><h3 id="heading-output">OUTPUT</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631941638/BswXxmaX-.png" alt="image.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658631967547/0Z3VtgPLk.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[IT's giT...]]></title><description><![CDATA[Git is a...

Version control system which allow you to track changes you make to your project files over time. 
By using git you can make a copy of your files, make changes to that copy, and then merge these changes to the original copy.

Why it's ne...]]></description><link>https://coder666.hashnode.dev/its-git</link><guid isPermaLink="true">https://coder666.hashnode.dev/its-git</guid><category><![CDATA[Learn Code Online]]></category><category><![CDATA[iwritecode]]></category><category><![CDATA[@hiteshchoudharylco]]></category><category><![CDATA[ineuron]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Sun, 24 Jul 2022 02:29:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628971152/GC4iUSxZr.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-git-is-a">Git is a...</h2>
<ul>
<li>Version control system which allow you to track changes you make to your project files over time. </li>
<li>By using git you can make a copy of your files, make changes to that copy, and then merge these changes to the original copy.</li>
</ul>
<h2 id="heading-why-its-needed">Why it's needed?</h2>
<ul>
<li><p>It maintains a history of all changes made to the code. </p>
</li>
<li><p>The changes are stored in a special database called <strong>“repository”</strong>, also known as <strong>“repo”</strong>.</p>
</li>
</ul>
<h3 id="heading-heres-a-quick-cheat-sheet-to-easily-guide-you-through-the-process">Here's a quick cheat sheet to easily guide you through the process.</h3>
<hr />
<h2 id="heading-time-to-create-a-repository">Time to create a Repository</h2>
<p> Create a new local repository</p>
<blockquote>
<p>$ git init</p>
</blockquote>
<h2 id="heading-wanna-make-local-changes">Wanna Make Local Changes</h2>
<p>Add all current changes to the next commit</p>
<blockquote>
<p>$ git add</p>
</blockquote>
<p>Changes the last commit done</p>
<blockquote>
<p>$ git commit</p>
</blockquote>
<p>Changed files in your working directory</p>
<blockquote>
<p>$ git status</p>
</blockquote>
<h2 id="heading-check-the-history-too">Check the history too..</h2>
<p>Shows all commits, starting with newest</p>
<blockquote>
<p>$ git log</p>
</blockquote>
<h2 id="heading-easy-to-branch-as-well">Easy to branch as well</h2>
<p>Lists all existing branches</p>
<blockquote>
<p>$ git branch -av</p>
</blockquote>
<p>Will Switch Head branch</p>
<blockquote>
<p>$ git checkout &lt; branch &gt;</p>
</blockquote>
<h2 id="heading-time-to-go-online-andamp-publish">Time to go online &amp; publish</h2>
<p>Shows information about a remote</p>
<blockquote>
<p>$ git remote show&lt; remote &gt;</p>
</blockquote>
<p>Download changes and directly merge/integrate into HEAD</p>
<blockquote>
<p>$ git pull &lt; remote &gt; &lt; branch &gt;</p>
</blockquote>
<p>Publish local changes on a remote</p>
<blockquote>
<p>$ git push &lt; remote&gt; &lt; branch &gt;</p>
</blockquote>
<p>Abort a rebase</p>
<blockquote>
<p>$ git rebase --abort</p>
</blockquote>
<p>Merge &lt; branch &gt; into your current HEAD</p>
<blockquote>
<p>$ git merge &lt; branch &gt;</p>
</blockquote>
<p>Rebase your current HEAD onto &lt; branch&gt;</p>
<blockquote>
<p>$ git rebase &lt; branch &gt;</p>
</blockquote>
<p>Publish your tags</p>
<blockquote>
<p>$ git push --tags</p>
</blockquote>
<h2 id="heading-made-some-error-undo">Made some error (UNDO)</h2>
<p>Preserve uncommitted local changes</p>
<blockquote>
<p>$ git reset --keep &lt; commit &gt;</p>
</blockquote>
<p>Discard all local changes in your working directory</p>
<blockquote>
<p>$ git reset &lt; commit &gt;</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Welcome to Markdown]]></title><description><![CDATA[Markdown is a simple syntax that formats text as headers, lists, boldface, and so on.  It is an easy-to-use markup language you can use to format virtually any document. This markup language is infamous, supported across multiple platforms. 
Infact, ...]]></description><link>https://coder666.hashnode.dev/welcome-to-markdown</link><guid isPermaLink="true">https://coder666.hashnode.dev/welcome-to-markdown</guid><category><![CDATA[Learn Code Online]]></category><category><![CDATA[iwritecode]]></category><category><![CDATA[markdown]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Sun, 24 Jul 2022 02:13:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1658626572117/XOH3sDPlE.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>M</strong>arkdown is a simple syntax that formats text as headers, lists, boldface, and so on.  It is an easy-to-use markup language you can use to format virtually any document. This markup language is infamous, supported across multiple platforms. </p>
<p>Infact, try spotting the usage within this article itself.</p>
<h1 id="heading-what-is-markdown">What Is Markdown?</h1>
<p>If you want to format your text such as "bold, italics, numbered lists, bullet points, headings," and so on to text, you’re “formatting” it. 
Markdown helps as a syntax—or, set of rules—that lets you format text on web pages.
Although people use other methods such as HTML, XML, etc. Things often get quite complex while using those languages especially with the long list of tags that at times even be forgotten. It’s not very “user-friendly” for people who don’t have a lot of experience reading it.</p>
<p>Let's begin with different comparatively easier syntaxes of markup languages.</p>
<h1 id="heading-heading">Heading</h1>
<ol>
<li>Comes in 6 different styles.</li>
<li>Increase the '#' hashes to decrease the header size.</li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<pre><code><span class="hljs-comment"># heading 1</span>
<span class="hljs-comment">## heading 2</span>
<span class="hljs-comment">### heading 3</span>
<span class="hljs-comment">#### heading 4</span>
<span class="hljs-comment">##### heading 5</span>
<span class="hljs-comment">###### heading 6</span>
</code></pre><h2 id="heading-output">OUTPUT</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658627594952/1d0JfayUX.png" alt="image.png" /></p>
<h1 id="heading-text-formatting-bold-italics-strikethrough">Text Formatting (Bold / Italics / Strikethrough)</h1>
<ol>
<li>Depends on the application and necessity of styling.</li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<pre><code><span class="hljs-operator">*</span><span class="hljs-operator">*</span>Bold<span class="hljs-operator">*</span><span class="hljs-operator">*</span>

__Bold__

<span class="hljs-operator">*</span>Italic<span class="hljs-operator">*</span>

<span class="hljs-operator">~</span><span class="hljs-operator">~</span><span class="hljs-number">999</span><span class="hljs-operator">~</span><span class="hljs-operator">~</span>
</code></pre><h2 id="heading-output">OUTPUT</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658627728957/1XUAwYo72.png" alt="image.png" /></p>
<h1 id="heading-list-down-some-items-ordered-unordered-list">List down some Items (Ordered / Unordered List)</h1>
<ol>
<li>Gives you the ability to create list depending on your choice.</li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<pre><code><span class="hljs-bullet">1.</span> One
<span class="hljs-bullet">2.</span> Two
<span class="hljs-bullet">    1.</span> lorem
<span class="hljs-bullet">    2.</span> ipsum
<span class="hljs-bullet">    3.</span> doros

<span class="hljs-bullet">1.</span> One
<span class="hljs-bullet">1.</span> Two
<span class="hljs-bullet">    1.</span> lorem
<span class="hljs-bullet">    1.</span> ipsum
<span class="hljs-bullet">    1.</span> doros

<span class="hljs-bullet">-</span> One
<span class="hljs-bullet">-</span> Two
<span class="hljs-bullet">    -</span>  lorem
<span class="hljs-bullet">    -</span>  ipsum
<span class="hljs-bullet">    -</span>  doros
</code></pre><h2 id="heading-output">OUTPUT</h2>
<p>You are already watching the output.</p>
<h1 id="heading-link-to-the-external-world-links-andamp-image-links">Link to the external world (Links &amp; Image Links)</h1>
<ol>
<li>When providing image links make sure to use of smaller images preferably in <strong>PNG format.</strong></li>
<li>Use an additional <strong>!</strong> symbol to denote that link is an image link.</li>
<li>Square braces <strong>[ ]</strong> denote Link text or Image text (when image unavailable).</li>
<li>Inverted commas have <strong>meta text</strong> or <strong>hover text.</strong></li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<pre><code>[Home] (https://coder666.hashnode.dev/ "CSS") 
![<span class="hljs-string">Mascot</span>](<span class="hljs-link">https://learncodeonline.in/mascot.png</span>)
</code></pre><h2 id="heading-output">OUTPUT</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628347142/TlaaPfkQi.png" alt="image.png" /></p>
<h1 id="heading-code-snippets">Code Snippets</h1>
<ol>
<li>It is used to display a code editor type formatted code.</li>
<li>It supports most known languages.</li>
<li>Make sure to specify language in lowercase with no-space in beginning to color-format per specific to the coded language format.</li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628438445/u62xFJbLW.png" alt="image.png" /></p>
<p>##OUTPUT</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628460906/t4r2r4EDU.png" alt="image.png" /></p>
<h1 id="heading-pen-down-paras-blockquote-line-divider-paragraph">Pen down para's (Blockquote / Line divider / Paragraph)</h1>
<ol>
<li>Blockquotes are majorly used to show output or quotes  using &gt; symbol used.</li>
<li>Line divider is used to show line formatted separation in document. 
 Use triple asterisk <strong>(*</strong>)** to denote line divide.</li>
<li>No specific syntax for paragraph.</li>
</ol>
<h2 id="heading-syntax">SYNTAX</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628702371/O8I0cuw_Q.png" alt="image.png" /></p>
<p>#OUTPUT</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658628729216/6XImcr-O0.png" alt="image.png" /></p>
<blockquote>
<p>So, go ahead implement them to write easy documentations in no time. </p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Pseudo Selectors - 101]]></title><description><![CDATA[Imagine yourself going through a long list of students in a school. We have set different sections to assign and sort students based on their let's say preferred choice of sports. 
However it's still massive data, how do you find a particular student...]]></description><link>https://coder666.hashnode.dev/pseudo-selectors-101</link><guid isPermaLink="true">https://coder666.hashnode.dev/pseudo-selectors-101</guid><category><![CDATA[HTML5]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[Pseudo-classes ]]></category><category><![CDATA[#iwritecode  #hiteshchoudhary  #LCO  #markdown #git  #github]]></category><category><![CDATA[Learn Code Online]]></category><dc:creator><![CDATA[MUKUL BASU]]></dc:creator><pubDate>Fri, 22 Jul 2022 16:55:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1658506882128/z_2dbY0Ek.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>I</strong>magine yourself going through a long list of students in a school. We have set different sections to assign and sort students based on their let's say preferred choice of sports. 
However it's still massive data, how do you find a particular student among the mix? 
Simple - Design a selection criteria to target the particular parameter based on certain parameters.
This might not be an accurate analogy but is close enough to get you a hang of the topic in hand to be discussed, 'pseudo-selectors.' </p>
<p>Pseudo selectors are the tools that let you design or format certain elements in a webpage based upon the conditions listed in selector criteria. 
Take the instance of a website such as <a target="_blank" href="https://mediadistribution.espn.com/">Media Distribution ESPN</a>. A fairly looking website at the very first glance and very well designed. However, notice when you hover over their sports category section. Notice the change in the animation and the shift in the background image of the individual compartment changing based on the respective sports they target.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658507584844/Zz5YTjaJD.png" alt="image.png" /></p>
<p>All this is the work of pseudo selectors.</p>
<p>Selectors are one of the pertinent elements of a CSS sheet. It helps you to target a section and implement style changes targeting that particular section. 
For example; in the code snippet given 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658507740695/i10D5n52s.png" alt="image.png" /></p>
<p>It can be easily understood that it is a button tag. In order to design it, we select the button tag using its respective class name.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658507838444/Krx7C0ZGo.png" alt="image.png" /></p>
<p>But what if you want to make it highlight or change the background colour when it's hovered over?
In comes <strong>PSEUDO SELECTOR</strong>. Pseudo as the meaning suggests something that is not genuine or real. Pseudo selectors or pseudo-classes are in fact elements that uphold that value. They are special criteria assigned to selectors and only come in whenever the pseudo conditions are applicable.</p>
<p>Syntax: selector:pseudo selector { /<em>styling elements</em>/}</p>
<p>Thus for the given case, to make it turn dark red when hovered over, we use the following pseudo selector.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658508269244/njQAUDzot.png" alt="image.png" /></p>
<p>Which makes it turn from this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658508315695/vySSQwFqJ.png" alt="2022-07-22.png" />
-&gt; to this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1658508343422/ZmJfpO_Ey.png" alt="2022-07-22 (1).png" /></p>
<p>Here is the list of certain pseudo selectors followed by their condition requirements. (Considered for  tag, with class name btn1)</p>
<ol>
<li>".btn:hover" { /<em>styling elements</em>/ }             -               Allows to style when the button is hovered over</li>
<li>".btn:active" { /<em>styling elements</em>/ }            -               Allows you to style the button when active (clicked)</li>
<li>".btn:visited" { /<em>styling elements</em>/ }           -               Allows you to style the button for times when it has   <pre><code>                                                                                     <span class="hljs-attribute">been</span> clicked <span class="hljs-literal">on</span> at least once
</code></pre></li>
</ol>
<p>Refer to the <a target="_blank" href="https://codesandbox.io/s/live-class-project-2-forked-sbo4zk">SANDBOX</a> link for the snippet code reference.</p>
]]></content:encoded></item></channel></rss>