<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jay Rajput</title>
    <description>The latest articles on DEV Community by Jay Rajput (@jayrajput30).</description>
    <link>https://dev.to/jayrajput30</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F518611%2F9ab1236e-6968-44f0-b92b-fdf31930fdb0.jpeg</url>
      <title>DEV Community: Jay Rajput</title>
      <link>https://dev.to/jayrajput30</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jayrajput30"/>
    <language>en</language>
    <item>
      <title>Deep dive into CSS selector combinations</title>
      <dc:creator>Jay Rajput</dc:creator>
      <pubDate>Sat, 12 Dec 2020 09:47:43 +0000</pubDate>
      <link>https://dev.to/jayrajput30/deep-dive-into-css-selector-combinations-a91</link>
      <guid>https://dev.to/jayrajput30/deep-dive-into-css-selector-combinations-a91</guid>
      <description>&lt;p&gt;In CSS, selectors are used to target the HTML elements we want to style. We can combine selectors to get meaningful relationship and target specific elements. Below are some of the less used but handy selector combinations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Descendant combinator&lt;/li&gt;
&lt;li&gt;Child combinator&lt;/li&gt;
&lt;li&gt;Adjacent sibling&lt;/li&gt;
&lt;li&gt;Child sibling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will refers to below HTML code block for understanding combinator selectors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DQU35t35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k4swkqfw909842xfnavf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DQU35t35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k4swkqfw909842xfnavf.png" alt="HTML example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Descendant combinator
&lt;/h3&gt;

&lt;p&gt;Descendant combinator selects a combination where the second selector is descendant for first selector.  Second selector does not needs to be a direct descendant for first selector and is separated from first selector by a white-space.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Here all the descendant paragraphs of the .container class will have the text colored orange.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gtxVmrt6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/97ssqbzjl0ietw8vy037.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gtxVmrt6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/97ssqbzjl0ietw8vy037.PNG" alt="descandant combinator"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Child Combinator
&lt;/h3&gt;

&lt;p&gt;This type of combinator selects only the element matched by the second selector that are direct children of first selector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container&amp;gt;p{
  color: blue;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After applying the above combinator only the paragraphs that are direct children of .container class will have background color of blue.  Notice below that paragraph four is still the same since it is not a direct child of .container parent class.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YUxWCv1o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jbiefpu92dui60d7dchg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YUxWCv1o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jbiefpu92dui60d7dchg.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adjacent Sibling
&lt;/h3&gt;

&lt;p&gt;This combination matches only second element that immediately follows the first element. The selectors are separated by "+" symbol and they both belong to the same parent element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a + p{
  background-color: grey;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After applying above combination, the paragraph that immediately follows the anchor tag (abc site in this case) will have a background color of grey.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N9K1n12P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dottm1tjwkmiyg2aoroz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N9K1n12P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dottm1tjwkmiyg2aoroz.PNG" alt="Adjacent Selector"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  General Sibling
&lt;/h3&gt;

&lt;p&gt;General sibling combinator matches the second elements that are adjacent siblings(not necessarily immediate sibling) of the first element and belong to same parent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;span ~ p{
  color:yellow;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After applying the above combination, all the adjacent paragraphs following span tag will have text colored yellow.  Notice that paragraph four is not selected since it does not belongs to the same parent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FD-Ig7yn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x7rm0guwtzm5k6ovksam.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FD-Ig7yn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x7rm0guwtzm5k6ovksam.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;QUIZ TIME&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container p[class*="para-four"]{
  color: black;
  background-color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What do you think the above selector combination will display and why?🤔&lt;br&gt;
Let's hear out in comments!&lt;/p&gt;

&lt;p&gt;For more details about selectors checkout &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors"&gt;MDN&lt;/a&gt; site&lt;/p&gt;

</description>
      <category>css</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Learning how to learn</title>
      <dc:creator>Jay Rajput</dc:creator>
      <pubDate>Thu, 26 Nov 2020 04:47:37 +0000</pubDate>
      <link>https://dev.to/jayrajput30/learning-how-to-learn-15ea</link>
      <guid>https://dev.to/jayrajput30/learning-how-to-learn-15ea</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The most successful people in the world are lifelong students.  That means they're continuously learning new skills, keeping up with the latest in their chose field, and staying apprise of what the other field have to offer them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Jim Kwik&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A person's approach to learning is the very important factor in mastering any subject that he is interested in.  That's why learning how to learn is such an important aspect.  The books &lt;strong&gt;LIMITLESS&lt;/strong&gt; by &lt;strong&gt;Jim Kwik&lt;/strong&gt; changed my whole perspective about learning.  I would like to share a few things that help me to understand and learn new things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Active Recall and Spaced Repetition
&lt;/h2&gt;

&lt;p&gt;This one plays a major role in how well I understand and retain the information.  Once I go through some topic I try to summarize what I have learnt.  This makes sure I am actively engaged in the topic I am learning not just cramming through the information.  Also once I complete a good chunk of topic, I go back to it after a while and try to recollect as much information as possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliberate Practice
&lt;/h2&gt;

&lt;p&gt;One the habit I have is skimming over the difficult part.  It comes out of sheer comfort zone.  But whenever this happens I try to force myself to sit uptight and break the topic into small group of concepts so that it becomes easy to grasp.&lt;/p&gt;

&lt;h2&gt;
  
  
  State while learning
&lt;/h2&gt;

&lt;p&gt;Learning is state dependent.  I make sure I sit in a proper posture and make sure that the I am consuming the most important topic of my life.  If have observed that if I slouch and have no interest in the topic then I retain less information.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Active note taking
&lt;/h2&gt;

&lt;p&gt;I make sure I have a goal in mind before I start making notes for any topic.  Also I don't write down every bit of information on note, just the bullet points.  Also I make sure I go over the notes once I have written them down just to make sure  I have note missed out any information.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;What about you?&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;How do you approach learning and what the some tips you follow to learn better.  I would love to hear them out. &lt;/p&gt;

</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
