<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ style - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ style - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 27 Jul 2026 10:32:07 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/style/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ CSS Selector Types – How to Select Elements to Style in CSS ]]>
                </title>
                <description>
                    <![CDATA[ By Dillion Megida When you want to style an element with CSS, you first have to "select" it. In this article, I'll show you seven (7) ways in which you can do that. Here's the syntax for styling elements in CSS: selector {   /* styles here */ } ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-select-elements-to-style-in-css/</link>
                <guid isPermaLink="false">66d84f19f6f7ca5a604624e7</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 19 Sep 2022 22:01:13 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/09/css-selector-types.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dillion Megida</p>
<p>When you want to style an element with CSS, you first have to "select" it. In this article, I'll show you seven (7) ways in which you can do that.</p>
<p>Here's the syntax for styling elements in CSS:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">selector</span> {
  <span class="hljs-comment">/* styles here */</span>
}
</code></pre>
<p>You have the selector that "targets" the element(s) you want to style, then you have an open curly brace. After the brace, you have your styles using different CSS properties, and you close it with a closing curly brace.</p>
<p>There are numerous ways to target elements. You can call these methods <strong>Selector Types</strong>.</p>
<p>Here is a video with examples on <a target="_blank" href="https://www.youtube.com/watch?v=0yysG5U_2i8">Ways to Select Elements to Style in CSS</a> if you prefer that.</p>
<p>Here are seven selector types in CSS.</p>
<h2 id="heading-1-how-to-use-the-universal-selector-in-css">1. How to Use the Universal Selector (*) in CSS</h2>
<p>The Universal Selector, <strong>asterisk</strong> (*), allows you to select ALL elements of any type for styling. Here is an example:</p>
<pre><code class="lang-css">* {
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid black;
}
</code></pre>
<p>Let's say we use this style for the following HTML:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>CSS styles<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>How to apply styles<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"20px"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"20px"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://www.freecodecamp.org/news/content/images/size/w150/2022/03/deee.jpg"</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<p>Here is the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image--3-.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can see that the <code>body</code>, <code>h1</code>, <code>p</code>, <code>div</code>, and <code>img</code> elements all have the <code>border</code> of <strong>1px solid black</strong> because we used the universal selector.</p>
<h2 id="heading-2-how-to-style-elements-by-tag-name-in-css">2. How to Style Elements by Tag Name in CSS</h2>
<p>You can also select elements for styling by using their tag names. Here's an example:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">color</span>: red;
}

<span class="hljs-selector-tag">img</span> {
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100px</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">100px</span>;
}
</code></pre>
<p>These style declarations applies a <code>color</code> of <strong>red</strong> to all <code>p</code> elements and a <code>width</code> and <code>height</code> of <strong>200px</strong> to all <code>img</code> elements.</p>
<p>Here's how the style above works with this HTML:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span>I am a span<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>There is a span above me<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://www.freecodecamp.org/news/content/images/size/w150/2022/03/deee.jpg"</span> /&gt;</span>
</code></pre>
<p>The result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-383.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can see that the <code>span</code> is not styled – only the <code>img</code> and the <code>p</code> are.</p>
<h2 id="heading-3-how-to-style-classes-in-css">3. How to Style Classes in CSS</h2>
<p>Elements accept different attributes (also called properties), including classes. You can target an element based on the class you have specified on it. Here is an example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Hello<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>How are you<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>There are two <code>div</code>s here, but only one has a class attribute with the <strong>container</strong> value. You can style the one with the class using a <strong>period</strong> (<strong>.</strong>) then the class like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span> {
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid purple;
}

<span class="hljs-selector-class">.container</span> {
  <span class="hljs-attribute">border-width</span>: <span class="hljs-number">20px</span>;
}
</code></pre>
<p>Here's the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image--5-.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>From the CSS, we specified that all <code>div</code> elements should have a <code>border</code> of <strong>1px solid purple</strong>. But for the element with a <strong>container</strong> <code>class</code>, you can see from the result that it has a <code>border-width</code> of 20px.</p>
<h2 id="heading-4-how-to-style-ids-in-css">4. How to Style Ids in CSS</h2>
<p>Similar to the <code>class</code> attribute, you can specify an <code>id</code> on an element which you can target from CSS for styling.</p>
<p>Here is an example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Hello<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>How are you<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>You can target the <code>id</code> element here by using a <strong>hash</strong> (<strong>#</strong>) and then the id like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-id">#container</span> {
  <span class="hljs-attribute">border-left</span>: <span class="hljs-number">10px</span> solid blue;
}
</code></pre>
<p>Here's the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-385.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Using the element (whether it's a <code>div</code>, <code>p</code>, or any type) with the <strong>container</strong> <code>id</code>, we applied styles to only the second <code>div</code> element.</p>
<p>Unlike classes, however, <code>id</code>s must be <strong>unique</strong>. Two or more elements cannot have the same <code>id</code> as that would cause unexpected behaviors.</p>
<h2 id="heading-5-how-to-style-other-attributes-in-css">5. How to Style Other Attributes in CSS</h2>
<p>We've seen how to target <code>class</code> and <code>id</code> attributes. What if you wanted to target other attributes? Well you can; using <strong>square brackets</strong> (<strong>[attr]</strong>). How does that work?</p>
<p>Let's see an example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>
    Some link
<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://google.com"</span>&gt;</span>
    A paragraph link
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p>In this example, we have two elements: an <code>a</code> tag and a <code>p</code> tag. To style both elements, you can use their tag names directly:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span>, <span class="hljs-selector-tag">a</span> {
  <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<p>The comma allows you to apply styles to multiple selectors at once.</p>
<p>But another way you can style both elements is using their attributes. They both have a <code>href</code> attribute.</p>
<p>Just keep in mind that the <code>href</code> attribute is not supported in <code>p</code> tags though. I'm just using it to illustrate an example.</p>
<p>Here's how you can use the <code>href</code> attribute to style both elements:</p>
<pre><code class="lang-css"><span class="hljs-selector-attr">[href]</span> {
  <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<p>This CSS will match all elements with the <code>href</code> attribute.</p>
<p>Here's the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-386.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Both elements have the <code>href</code> attribute and so they are selected for our styles. Here, we used the <code>href</code> attribute without a value. You can also specify a value to be specific about your target like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-attr">[href=<span class="hljs-string">"#"</span>]</span> {
  <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<p>Here's the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-387.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Only the <code>a</code> tag has the <code>href</code> attribute with the <strong>#</strong> value so that is the only element that matches our styles, as you can see from the image above.</p>
<h2 id="heading-6-how-to-use-pseudo-classes-in-css">6. How to Use Pseudo-Classes in CSS</h2>
<p>Pseudo-classes are selector types that allow you to select elements in a particular state. To name a few, here are some supported states:</p>
<ul>
<li><code>hover</code> (when the mouse floats over an element)</li>
<li><code>disabled</code> (when an element such as an input or button is disabled)</li>
<li><code>required</code> (when a form element is required)</li>
</ul>
<p>And many more you can find in the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes">Pseudo-classes MDN Documentation</a>.</p>
<p>You can apply styles when elements are in these states. You select the state by using a <strong>colon</strong> (<strong>:</strong>) followed by the state. Here is an example:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>
    Hover me
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
</code></pre>
<p>The <code>&lt;!DOCTYPE html&gt;</code> line is important to specify that it is HTML5 so the pseudo classes can work.</p>
<p>And here's the CSS:</p>
<pre><code class="lang-css"><span class="hljs-selector-pseudo">:hover</span> {
  <span class="hljs-attribute">background-color</span>: black;
  <span class="hljs-attribute">color</span>: white;
}
</code></pre>
<p>This CSS would apply these styles to any element you hover over. Here's the result":</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-388.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The image on the left is without the hover state. On the right, you can see the styles applied to the <code>body</code> and the <code>button</code> because we're hovering over them.</p>
<p>By hovering over the <code>button</code>, you are also hovering over the <code>body</code> because the <code>button</code> is a child of the <code>body</code>.</p>
<h2 id="heading-7-how-to-use-the-pseudo-element-selector-in-css">7. How to Use the Pseudo Element Selector in CSS</h2>
<p>Pseudo-elements (different from Pseudo Classes) are used to select a "specific part of an element". Not the whole element – just a part. And you can also use them to add pseudo (artificial) elements to an existing element.</p>
<p>Here's a detailed article on <a target="_blank" href="https://dillionmegida.com/p/pseudo-elements-vs-pseudo-classes-in-css/">Pseudo elements vs Pseudo-classes in CSS</a></p>
<p>Here are some supported pseudo-element selectors:</p>
<ul>
<li><code>selection</code>: the highlighted part of an element</li>
<li><code>first-line</code>: the first line of a paragraph</li>
<li><code>placeholder</code>: the placeholder text of an input element</li>
</ul>
<p>And many more you can find in the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements">MDN Pseudo Elements Documentation</a>.</p>
<p>To apply styles using a pseudo-element selector, you use <strong>double colons</strong> (<strong>::</strong>) followed by the pseudo-element. Here's an example:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">placeholder</span>=<span class="hljs-string">"Enter some text"</span> /&gt;</span>
</code></pre>
<p>And here's the CSS for this HTML:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">input</span> {
  <span class="hljs-attribute">color</span>: blue;
}

<span class="hljs-selector-pseudo">::placeholder</span> {
  <span class="hljs-attribute">color</span>: red;
  <span class="hljs-attribute">font-style</span>: italic;
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-389.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The <code>::placeholder</code> pseudo-element selector styles the "placeholder part" of all form elements. As you can see in the example above, the <code>input</code> element itself has a <code>color</code> style of <strong>blue</strong> but the placeholder part has different styling.</p>
<h2 id="heading-wrapping-up">Wrapping up</h2>
<p>In this article, I've shown you seven ways in which you can target elements you want to style. We've seen:</p>
<ul>
<li>the universal selector, for selecting all elements</li>
<li>tag names for selecting elements that match a tag name</li>
<li>classes for selecting elements with a class attribute</li>
<li>ids for selecting an element with an id attribute</li>
<li>attributes for selecting elements that have an attribute with or without a specified value</li>
<li>pseudo-classes for selecting elements in a specific state</li>
<li>pseudo-elements for selecting specific parts of an element</li>
</ul>
<p>You can also combine these selectors to be more specific about the element you want to target. You do this using <strong>Combinators</strong>.</p>
<p>Combinators allow you to use multiple selectors to target elements based on the relationship between the elements that match the selectors. Here's an <a target="_blank" href="https://www.freecodecamp.org/news/css-combinators-to-select-elements/">article I wrote about combinators if you want to learn more</a>.</p>
<p>To give you a quick preview – combinators are used between multiple selector types, and they allow you to style elements based on the relationship they have with other elements.</p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Inline Style in HTML – CSS Inline Styles ]]>
                </title>
                <description>
                    <![CDATA[ Cascading Style Sheets (CSS) is a markup language that determines how your web pages will appear. It manages the colors, fonts, and layouts of your website elements, as well as allowing you to add effects or animations to your pages. We can style an ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/inline-style-in-html/</link>
                <guid isPermaLink="false">66d45fc347a8245f78752a7a</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Joel Olawanle ]]>
                </dc:creator>
                <pubDate>Wed, 08 Jun 2022 21:24:31 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/06/cover-template-1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Cascading Style Sheets (CSS) is a markup language that determines how your web pages will appear. It manages the colors, fonts, and layouts of your website elements, as well as allowing you to add effects or animations to your pages.</p>
<p>We can style an HTML file/page in three ways: external styling, internal styling, and inline styling. In this article, we'll be focusing on inline styling.</p>
<h2 id="heading-how-to-use-inline-style-in-html">How to Use Inline Style in HTML</h2>
<p>Using the style attribute, we can apply styling to our HTML inside individual HTML tags with inline styling.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"..."</span>&gt;</span>...<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
</code></pre>
<p>The style attribute works in the same way as any other HTML attribute. We use <code>style</code>, followed by the equality sign (=), and then a quote where all of the style values will be stored using the standard CSS property-value pairs - <code>"property: value;"</code>.</p>
<p><strong>Note:</strong> We can have as many property-value pairs as we want as long as we separate them with a semicolon (;).</p>
<p>It's worth noting that the <code>style</code> attribute is typically used in the opening HTML tag because that's the part of the HTML element that can contain text, data, an image, or nothing at all. An example of inline style is as follows:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color: red; font-size: 40px;"</span>&gt;</span>Hello World<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
</code></pre>
<p>This is similar to this:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">h1</span> {
  <span class="hljs-attribute">color</span>: red;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">40px</span>;
}
</code></pre>
<p>The only difference is that the inline style applies only to the tag to which it is applied, whereas this second code example affects all <code>p</code> tags on your html page.</p>
<h3 id="heading-when-to-use-inline-styles">When to Use Inline Styles</h3>
<p>Using inline styles is not considered best practice, though, because it results in a lot of repetition – because the styles cannot be reused elsewhere.</p>
<p>But there are times when inline styles are the best (or only) option, such as when styling HTML e-mail, CMS content like WordPress, Drupal, and so on. You can also use them when styling dynamic content, which is HTML-created or changed by JavaScript.</p>
<p>With the exception of the <code>!important</code> declaration, inline styles have a <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance#Understanding_the_cascade">high specificity/highest priority</a>, which means they will override most other rules in internal and external stylesheets.</p>
<p>Assume we have two paragraph texts with inline styling set to <code>red</code> and internal styling set to <code>green</code>:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Hello World<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
       <span class="hljs-selector-tag">p</span> {
           <span class="hljs-attribute">color</span>: green;
       }
   </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color: red;"</span>&gt;</span>Paragraph one is red.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color: red;"</span>&gt;</span>Paragraph two is also red.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>The CSS from our inline styles will override the CSS from the internal styling, so both paragraphs will be <code>red</code>.</p>
<h2 id="heading-advantages-and-disadvantages-of-inline-styles">Advantages and Disadvantages of Inline styles</h2>
<p>So far, we've learned what inline style is and how to use it within HTML tags. Now, let's look at the advantages and disadvantages to see when we should use inline styles and when we shouldn't.</p>
<h3 id="heading-advantages-of-inline-css">Advantages of Inline CSS:</h3>
<ul>
<li><p>Inline takes precedence over all other styles. Any styles defined in the internal and external style sheets are overridden by inline styles.</p>
</li>
<li><p>You can quickly and easily insert CSS rules into an HTML page, which is useful for testing or previewing changes and performing quick fixes on your website.</p>
</li>
<li><p>There is no need to create an additional file.</p>
</li>
<li><p>To apply styling in JavaScript, use the <code>style</code> attribute.</p>
</li>
</ul>
<h3 id="heading-disadvantages-of-inline-css">Disadvantages of Inline CSS:</h3>
<ul>
<li><p>Adding CSS rules to each HTML element takes time and makes your HTML structure unorganized. It's difficult to keep up, reuse, and scale.</p>
</li>
<li><p>The size and download time of your page can be affected by styling multiple elements.</p>
</li>
<li><p>Inline styles cannot be used to style pseudo-elements and pseudo-classes. For example, you can style the visited, hover, active, and link colors of an anchor tag using external and internal style sheets.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, we learned how to use inline style in HTML, when to use it, and some of the benefits and drawbacks of doing so.</p>
<p>Since inline styling takes precedence over all other styles, one of the best times to use it is when testing or previewing changes and performing quick fixes on your website.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Style Your React App – 5 Ways to Write CSS in 2021 ]]>
                </title>
                <description>
                    <![CDATA[ When it comes to styling your React app, you have a ton of different options. Which do you choose? I have broken down the 5 primary ways you have to choose between when writing CSS in your React app. There is no #1 way to approach to writing styles i... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-style-react-apps-with-css/</link>
                <guid isPermaLink="false">66d0378c2b211a17e00e36ec</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ React ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Reed ]]>
                </dc:creator>
                <pubDate>Fri, 16 Jul 2021 18:41:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/07/how-to-style-react-apps.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When it comes to styling your React app, you have a ton of different options. Which do you choose?</p>
<p>I have broken down the 5 primary ways you have to choose between when writing CSS in your React app.</p>
<p>There is no #1 way to approach to writing styles in React for every project. Every project is different and has different needs.</p>
<p>That's why at the end of each section, I will cover the pros and cons of each approach to help you choose which is the best for you in your projects.</p>
<p>Let's get started!</p>
<h2 id="heading-what-we-will-be-coding">What We Will Be Coding</h2>
<p>To see how the code for each of these styling approaches compare with one another, we will create the same example: a simple, but clean testimonial card. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/Screen-Shot-2021-07-14-at-12.07.40-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<blockquote>
<p>Want to code along with each of these examples? Go to <a target="_blank" href="https://react.new">react.new</a> to create a new React application instantly ✨</p>
</blockquote>
<h2 id="heading-inline-styles">Inline Styles</h2>
<p>Inline styles are the most direct away to style any React application.</p>
<p>Styling elements inline doesn't require you to create a separate stylesheet. </p>
<p>Style applied directly to the elements as compared to styles in a stylesheet also have higher precedence. This means that they "override" other style rules that may be applied to an element.</p>
<p>Here is our testimonial card styled with inline styles:</p>
<pre><code class="lang-js"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">section</span>
      <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span>
        <span class="hljs-attr">fontFamily:</span> '<span class="hljs-attr">-apple-system</span>',
        <span class="hljs-attr">fontSize:</span> "<span class="hljs-attr">1rem</span>",
        <span class="hljs-attr">fontWeight:</span> <span class="hljs-attr">1.5</span>,
        <span class="hljs-attr">lineHeight:</span> <span class="hljs-attr">1.5</span>,
        <span class="hljs-attr">color:</span> "#<span class="hljs-attr">292b2c</span>",
        <span class="hljs-attr">backgroundColor:</span> "#<span class="hljs-attr">fff</span>",
        <span class="hljs-attr">padding:</span> "<span class="hljs-attr">0</span> <span class="hljs-attr">2em</span>"
      }}
    &gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span>
        <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span>
          <span class="hljs-attr">textAlign:</span> "<span class="hljs-attr">center</span>",
          <span class="hljs-attr">maxWidth:</span> "<span class="hljs-attr">950px</span>",
          <span class="hljs-attr">margin:</span> "<span class="hljs-attr">0</span> <span class="hljs-attr">auto</span>",
          <span class="hljs-attr">border:</span> "<span class="hljs-attr">1px</span> <span class="hljs-attr">solid</span> #<span class="hljs-attr">e6e6e6</span>",
          <span class="hljs-attr">padding:</span> "<span class="hljs-attr">40px</span> <span class="hljs-attr">25px</span>",
          <span class="hljs-attr">marginTop:</span> "<span class="hljs-attr">50px</span>"
        }}
      &gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span>
          <span class="hljs-attr">src</span>=<span class="hljs-string">"https://randomuser.me/api/portraits/women/48.jpg"</span>
          <span class="hljs-attr">alt</span>=<span class="hljs-string">"Tammy Stevens"</span>
          <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span>
            <span class="hljs-attr">margin:</span> "<span class="hljs-attr">-90px</span> <span class="hljs-attr">auto</span> <span class="hljs-attr">30px</span>",
            <span class="hljs-attr">width:</span> "<span class="hljs-attr">100px</span>",
            <span class="hljs-attr">borderRadius:</span> "<span class="hljs-attr">50</span>%",
            <span class="hljs-attr">objectFit:</span> "<span class="hljs-attr">cover</span>",
            <span class="hljs-attr">marginBottom:</span> "<span class="hljs-attr">0</span>"
          }}
        /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">p</span>
            <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span>
              <span class="hljs-attr">lineHeight:</span> <span class="hljs-attr">1.5</span>,
              <span class="hljs-attr">fontWeight:</span> <span class="hljs-attr">300</span>,
              <span class="hljs-attr">marginBottom:</span> "<span class="hljs-attr">25px</span>",
              <span class="hljs-attr">fontSize:</span> "<span class="hljs-attr">1.375rem</span>"
            }}
          &gt;</span>
            This is one of the best developer blogs on the planet! I read it daily to improve my skills.
          <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>
          <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span>
            <span class="hljs-attr">marginBottom:</span> "<span class="hljs-attr">0</span>",
            <span class="hljs-attr">fontWeight:</span> <span class="hljs-attr">600</span>,
            <span class="hljs-attr">fontSize:</span> "<span class="hljs-attr">1rem</span>"
          }}
        &gt;</span>
          Tammy Stevens
          <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{{</span> <span class="hljs-attr">fontWeight:</span> <span class="hljs-attr">400</span> }}&gt;</span> · Front End Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span></span>
  );
}
</code></pre>
<p>Despite a few quick benefits, inline styles are only an acceptable choice for very small applications. The difficulties with inline styles become apparent as your code base grows even slightly.</p>
<p>As the code example above shows, even a small component like this becomes very bulky if all the styles are inline.</p>
<p>One quick trick however is to put inline styles into reusable variables, which can be stored in a separate file:</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> styles = {
  <span class="hljs-attr">section</span>: {
    <span class="hljs-attr">fontFamily</span>: <span class="hljs-string">"-apple-system"</span>,
    <span class="hljs-attr">fontSize</span>: <span class="hljs-string">"1rem"</span>,
    <span class="hljs-attr">fontWeight</span>: <span class="hljs-number">1.5</span>,
    <span class="hljs-attr">lineHeight</span>: <span class="hljs-number">1.5</span>,
    <span class="hljs-attr">color</span>: <span class="hljs-string">"#292b2c"</span>,
    <span class="hljs-attr">backgroundColor</span>: <span class="hljs-string">"#fff"</span>,
    <span class="hljs-attr">padding</span>: <span class="hljs-string">"0 2em"</span>
  },
  <span class="hljs-attr">wrapper</span>: {
    <span class="hljs-attr">textAlign</span>: <span class="hljs-string">"center"</span>,
    <span class="hljs-attr">maxWidth</span>: <span class="hljs-string">"950px"</span>,
    <span class="hljs-attr">margin</span>: <span class="hljs-string">"0 auto"</span>,
    <span class="hljs-attr">border</span>: <span class="hljs-string">"1px solid #e6e6e6"</span>,
    <span class="hljs-attr">padding</span>: <span class="hljs-string">"40px 25px"</span>,
    <span class="hljs-attr">marginTop</span>: <span class="hljs-string">"50px"</span>
  },
  <span class="hljs-attr">avatar</span>: {
    <span class="hljs-attr">margin</span>: <span class="hljs-string">"-90px auto 30px"</span>,
    <span class="hljs-attr">width</span>: <span class="hljs-string">"100px"</span>,
    <span class="hljs-attr">borderRadius</span>: <span class="hljs-string">"50%"</span>,
    <span class="hljs-attr">objectFit</span>: <span class="hljs-string">"cover"</span>,
    <span class="hljs-attr">marginBottom</span>: <span class="hljs-string">"0"</span>
  },
  <span class="hljs-attr">quote</span>: {
    <span class="hljs-attr">lineHeight</span>: <span class="hljs-number">1.5</span>,
    <span class="hljs-attr">fontWeight</span>: <span class="hljs-number">300</span>,
    <span class="hljs-attr">marginBottom</span>: <span class="hljs-string">"25px"</span>,
    <span class="hljs-attr">fontSize</span>: <span class="hljs-string">"1.375rem"</span>
  },
  <span class="hljs-attr">name</span>: {
    <span class="hljs-attr">marginBottom</span>: <span class="hljs-string">"0"</span>,
    <span class="hljs-attr">fontWeight</span>: <span class="hljs-number">600</span>,
    <span class="hljs-attr">fontSize</span>: <span class="hljs-string">"1rem"</span>
  },
  <span class="hljs-attr">position</span>: { <span class="hljs-attr">fontWeight</span>: <span class="hljs-number">400</span> }
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.section}</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.wrapper}</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span>
          <span class="hljs-attr">src</span>=<span class="hljs-string">"https://randomuser.me/api/portraits/women/48.jpg"</span>
          <span class="hljs-attr">alt</span>=<span class="hljs-string">"Tammy Stevens"</span>
          <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.avatar}</span>
        /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.quote}</span>&gt;</span>
            This is one of the best developer blogs on the planet! I read it
            daily to improve my skills.
          <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.name}</span>&gt;</span>
          Tammy Stevens
          <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">style</span>=<span class="hljs-string">{styles.position}</span>&gt;</span> · Front End Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span></span>
  );
}
</code></pre>
<p>Despite this improvement, inline styles do not have a number of essential features that any simple CSS stylesheet could provide.</p>
<p>For example, you cannot write animations, styles for nested elements (i.e. all child elements, first-child, last-child), pseudo-classes (i.e. :hover), and pseudo-elements (::first-line) to name a few.</p>
<p>If you're prototyping an application, inline styles are great. However, as you get further into making it, you will need to switch to another CSS styling option to give you basic CSS features.</p>
<p>👍 Pros:</p>
<ul>
<li>Quickest way to write styles</li>
<li>Good for prototyping (write inline styles then move to stylesheet)</li>
<li>Has great preference (can override styles from a stylesheet)</li>
</ul>
<p>👎 Cons:</p>
<ul>
<li>Tedious to convert plain CSS to inline styles</li>
<li>Lots of inline styles make JSX unreadable</li>
<li>You can not use basic CSS features like animations, selectors, etc.</li>
<li>Does not scale well</li>
</ul>
<h2 id="heading-plain-css">Plain CSS</h2>
<p>Instead of using inline styles, it's common to import a CSS stylesheet to style a component's elements.</p>
<p>Writing CSS in a stylesheet is probably the most common and basic approach to styling a React application, but it shouldn't be dismissed so easily.</p>
<p>Writing styles in "plain" CSS stylesheets is getting better all the time, due to an increasing set of features available in the CSS standard.</p>
<p>This includes features like CSS variables to store dynamic values, all manner of advanced selectors to select child elements with precision, and new pseudo-classes like <code>:is</code> and <code>:where</code>.</p>
<p>Here is our testimonial card written in plain CSS and imported at the top of our React application:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* src/styles.css */</span>

<span class="hljs-selector-tag">body</span> {
  <span class="hljs-attribute">font-family</span>: -apple-system, system-ui, BlinkMacSystemFont, <span class="hljs-string">"Segoe UI"</span>, Roboto, <span class="hljs-string">"Helvetica Neue"</span>, Arial, sans-serif;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1rem</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#292b2c</span>;
  <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff</span>;
}
<span class="hljs-selector-class">.testimonial</span> {
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span> auto;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">2em</span>;
}
<span class="hljs-selector-class">.testimonial-wrapper</span> {
  <span class="hljs-attribute">text-align</span>: center;
  <span class="hljs-attribute">max-width</span>: <span class="hljs-number">950px</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span> auto;
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#e6e6e6</span>;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">40px</span> <span class="hljs-number">25px</span>;
  <span class="hljs-attribute">margin-top</span>: <span class="hljs-number">50px</span>;
}
<span class="hljs-selector-class">.testimonial-quote</span> <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">300</span>;
  <span class="hljs-attribute">margin-bottom</span>: <span class="hljs-number">25px</span>;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1.375rem</span>;
}
<span class="hljs-selector-class">.testimonial-avatar</span> {
  <span class="hljs-attribute">margin</span>: -<span class="hljs-number">90px</span> auto <span class="hljs-number">30px</span>;
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100px</span>;
  <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>;
  <span class="hljs-attribute">object-fit</span>: cover;
  <span class="hljs-attribute">margin-bottom</span>: <span class="hljs-number">0</span>;
}
<span class="hljs-selector-class">.testimonial-name</span> {
  <span class="hljs-attribute">margin-bottom</span>: <span class="hljs-number">0</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">600</span>;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1rem</span>;
}
<span class="hljs-selector-class">.testimonial-name</span> <span class="hljs-selector-tag">span</span> {
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">400</span>;
}
</code></pre>
<pre><code class="lang-js"><span class="hljs-comment">// src/App.js</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">"./styles.css"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"testimonial"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"testimonial-wrapper"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span>
          <span class="hljs-attr">className</span>=<span class="hljs-string">"testimonial-avatar"</span>
          <span class="hljs-attr">src</span>=<span class="hljs-string">"https://randomuser.me/api/portraits/women/48.jpg"</span>
          <span class="hljs-attr">alt</span>=<span class="hljs-string">"Tammy Stevens"</span>
        /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"testimonial-quote"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>
            This is one of the best developer blogs on the planet! I read it daily to improve my skills.
          <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"testimonial-name"</span>&gt;</span>
          Tammy Stevens<span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span> · Front End Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span></span>
  );
}
</code></pre>
<p>For our testimonial card, note that we are creating classes to be applied to each individual element. These classes all start with the same name <code>testimonial-</code>.</p>
<p>CSS written in a stylesheet is a great first choice for your application. Unlike inline styles, it can style your application in virtually any way you need.</p>
<p>One minor problem might be your naming convention. Once you have a very well-developed application, it becomes harder to think of unique classnames for your elements, especially when you have 5 divs wrapped inside each other.</p>
<p>If you don't have a naming convention you are confident with (i.e. BEM), it can be easy to make mistakes, plus create multiple classes with the same name, which leads to conflicts.</p>
<p>Additionally, writing normal CSS can be more verbose and repetitive than newer tools like SASS/SCSS. As a result, it can take a bit longer to write your styles in CSS versus a tool like SCSS or a CSS-in-JS library.</p>
<p>Plus, it's important to note that since CSS cascades to all children elements, if you apply a CSS stylesheet to a component it is not just scoped to that component. All its declared rules will be transferred to any elements that are children of your styled component.</p>
<p>If you are confident with CSS, it is definitely a viable choice for you to style any React application. </p>
<p>With that being said, there are a number of CSS libraries that give us all the power of CSS with less code and include many additional features that CSS will never have on its own (such as scoped styles and automatic vendor prefixing).</p>
<p>👍 Pros:</p>
<ul>
<li>Gives us all of the tools of modern CSS (variables, advanced selectors, new pseudo-classes, etc.)</li>
<li>Helps us clean up our component files from inline styles</li>
</ul>
<p>👎 Cons:</p>
<ul>
<li>Need to setup vendor prefixing to ensure latest features work for all users</li>
<li>Requires more typing and boilerplate than other CSS libraries (i.e. SASS)</li>
<li>Any stylesheet cascades to component and all children; not scoped</li>
<li>Must use a reliable naming convention to ensure styles don't conflict</li>
</ul>
<h2 id="heading-sass-scss">SASS / SCSS</h2>
<p>What is SASS? SASS is an acronym that stands for: Syntactically Awesome Style Sheets.</p>
<p>SASS gives us some powerful tools, many of which don't exist in normal CSS stylesheets. It includes features like variables, extending styles, and nesting.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/Screen-Shot-2021-07-14-at-12.36.47-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>SASS allows us to write styles in two different kinds of stylesheets, with the extensions .scss and .sass.</p>
<p>SCSS styles are written in a similar syntax to normal CSS, however SASS styles do not require us to use open and closing brackets when writing style rules. </p>
<p>Here is a quick example of an SCSS stylesheet with some nested styles:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* styles.scss */</span>

<span class="hljs-selector-tag">nav</span> {
  ul {
    <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span>;
    <span class="hljs-attribute">list-style</span>: none;
  }

  <span class="hljs-selector-tag">li</span> { <span class="hljs-attribute">display</span>: inline-block; }

  <span class="hljs-selector-tag">a</span> {
    <span class="hljs-attribute">display</span>: block;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">6px</span> <span class="hljs-number">12px</span>;
    <span class="hljs-attribute">text-decoration</span>: none;
  }
}
</code></pre>
<p>Compare this with the same code written in a SASS stylesheet:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* styles.sass */</span>

<span class="hljs-selector-tag">nav</span>
  <span class="hljs-selector-tag">ul</span>
    <span class="hljs-selector-tag">margin</span>: 0
    <span class="hljs-selector-tag">padding</span>: 0
    <span class="hljs-selector-tag">list-style</span>: <span class="hljs-selector-tag">none</span>

  <span class="hljs-selector-tag">li</span>
    <span class="hljs-selector-tag">display</span>: <span class="hljs-selector-tag">inline-block</span>

  <span class="hljs-selector-tag">a</span>
    <span class="hljs-selector-tag">display</span>: <span class="hljs-selector-tag">block</span>
    <span class="hljs-selector-tag">padding</span>: 6<span class="hljs-selector-tag">px</span> 12<span class="hljs-selector-tag">px</span>
    <span class="hljs-selector-tag">text-decoration</span>: <span class="hljs-selector-tag">none</span>
</code></pre>
<p>Since this is not regular CSS, it needs to be compiled from SASS into plain CSS. To do so in our React projects, you can use a library like node-sass. </p>
<p>If you are using a Create React App project, to start using .scss and .sass files, you can install node-sass with npm:</p>
<pre><code class="lang-bash">npm install node-sass
</code></pre>
<p>Here is our testimonial card styled with SCSS:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* src/styles.scss */</span>

$<span class="hljs-selector-tag">font-stack</span>: <span class="hljs-selector-tag">-apple-system</span>, <span class="hljs-selector-tag">system-ui</span>, <span class="hljs-selector-tag">BlinkMacSystemFont</span>, "<span class="hljs-selector-tag">Segoe</span> <span class="hljs-selector-tag">UI</span>", <span class="hljs-selector-tag">Roboto</span>, "<span class="hljs-selector-tag">Helvetica</span> <span class="hljs-selector-tag">Neue</span>", <span class="hljs-selector-tag">Arial</span>, <span class="hljs-selector-tag">sans-serif</span>;
$<span class="hljs-selector-tag">text-color</span>: <span class="hljs-selector-id">#292b2c</span>;

%<span class="hljs-selector-tag">font-basic</span> {
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1rem</span>;
}

<span class="hljs-selector-tag">body</span> {
  @extend %font-basic;
  <span class="hljs-attribute">font-family</span>: $font-stack;
  <span class="hljs-attribute">color</span>: $text-color;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1rem</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff</span>;
}

<span class="hljs-comment">/* unchanged rules skipped */</span>

<span class="hljs-selector-class">.testimonial-name</span> {
  @extend %font-basic;
  <span class="hljs-attribute">margin-bottom</span>: <span class="hljs-number">0</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">600</span>;

  span {
    <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">400</span>;
  }
}
</code></pre>
<p>These styles give us the following features: variables, extending styles and nested styles.</p>
<p><strong>Variables</strong>: You can use dynamic values by writing variables, just like in JavaScript, by declaring them with a <code>$</code> at the beginning.</p>
<p>There are two variables that can be used in multiple rules: <code>$font-stack</code>, <code>$text-color</code>.</p>
<p><strong>Extending / Inheritance</strong>: You can add onto style rules by extending them. To extend rules, you create your own selector which can be reused like a variable. The name of rules that you want to extend start with <code>%</code>.</p>
<p>The variable <code>%font-basic</code> is inherited by the rules <code>body</code> and <code>.testimonial-name</code>.</p>
<p><strong>Nesting</strong>: Instead of writing multiple rules that begin with the same selector, you can nest them.</p>
<p>In <code>.testimonial-name</code> , we use a nested selector to target the <code>span</code> element within it.</p>
<p>You can find a working version of a React application with SCSS <a target="_blank" href="https://codesandbox.io/s/react-and-scss-forked-2xeu0?file=/src/styles.scss">here</a>.</p>
<p>👍 Pros:</p>
<ul>
<li>Includes many dynamic CSS features like extending, nesting, and mixins</li>
<li>CSS styles can be written with much less boilerplate over plain CSS</li>
</ul>
<p>👎 Cons:</p>
<ul>
<li>Like plain CSS, styles are global and not scoped to any one component</li>
<li>CSS stylesheets is starting to include a number of features that SASS had exclusively, such as CSS variables (not necessarily a con, but worth noting)</li>
<li>SASS / SCSS often requires setup, such as installing the Node library <code>node-sass</code></li>
</ul>
<h2 id="heading-css-modules">CSS Modules</h2>
<p>CSS modules are another slight alternative to something like CSS or SASS.</p>
<p>What is great about CSS modules is that they can be used with either normal CSS or SASS. Plus, if you are using Create React App you can start using CSS modules with no setup at all.</p>
<p>Here is our application written with CSS modules:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* src/styles.module.css */</span>

<span class="hljs-selector-tag">body</span> {
  <span class="hljs-attribute">font-family</span>: -apple-system, system-ui, BlinkMacSystemFont, <span class="hljs-string">"Segoe UI"</span>, Roboto, <span class="hljs-string">"Helvetica Neue"</span>, Arial, sans-serif;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1rem</span>;
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#292b2c</span>;
  <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff</span>;
}

<span class="hljs-comment">/* styles skipped */</span>

<span class="hljs-selector-class">.testimonial-name</span> <span class="hljs-selector-tag">span</span> {
  <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">400</span>;
}
</code></pre>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> styles <span class="hljs-keyword">from</span> <span class="hljs-string">'./styles.module.css'</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">section</span> <span class="hljs-attr">className</span>=<span class="hljs-string">{styles.testimonial}</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">{styles[</span>'<span class="hljs-attr">testimonial-wrapper</span>']}&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span>
          <span class="hljs-attr">src</span>=<span class="hljs-string">"https://randomuser.me/api/portraits/women/48.jpg"</span>
          <span class="hljs-attr">alt</span>=<span class="hljs-string">"Tammy Stevens"</span>
          <span class="hljs-attr">className</span>=<span class="hljs-string">{styles[</span>'<span class="hljs-attr">testimonial-avatar</span>']}
        /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">className</span>=<span class="hljs-string">{styles[</span>'<span class="hljs-attr">testimonial-quote</span>']}&gt;</span>
            This is one of the best developer blogs on the planet! I read it
            daily to improve my skills.
          <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">className</span>=<span class="hljs-string">{styles[</span>'<span class="hljs-attr">testimonial-name</span>']}&gt;</span>
          Tammy Stevens
          <span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span> · Front End Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">section</span>&gt;</span></span>
  );
}
</code></pre>
<p>Our CSS file has the name <code>.module</code> in it before the extension <code>.css</code>. Any CSS module file must have the name "module" in it and end in the appropriate extension (if we are using CSS or SASS/SCSS).</p>
<p>What is interesting to note if we look at the code above is that CSS modules are written just like normal CSS, but are imported and used as if it were created as objects (inline styles).</p>
<p>The benefit of CSS modules is that it helps avoid our problem of class conflicts with normal CSS. The properties that we are referencing turn into unique classnames that cannot conflict with one another when our project is built.</p>
<p>Our generated HTML elements will look like this:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"_styles__testimonial-name_309571057"</span>&gt;</span>
  Tammy Stevens
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p>Plus, CSS modules solve the problem of global scope in CSS. As compared to our normal CSS stylesheets, CSS declared using modules to individual components will not cascade to child components.</p>
<p>Therefore, CSS modules are best to use over CSS and SASS to make sure classes don't conflict and to write predictable styles that only apply to one or another component.</p>
<p>👍 Pros:</p>
<ul>
<li>Styles are scoped to one or another component (unlike CSS / SASS)</li>
<li>Unique, generated classnames ensure no style conflict</li>
<li>Can use them immediately without setup in CRA projects</li>
<li>Can be used with SASS / CSS</li>
</ul>
<p>👎 Cons:</p>
<ul>
<li>Can be tricky to reference classnames</li>
<li>May be a learning curve to use CSS styles like object properties</li>
</ul>
<h2 id="heading-css-in-js">CSS-in-JS</h2>
<p>Similar to how React allowed us to write HTML as JavaScript with JSX, CSS-in-JS has done something similar with CSS.</p>
<p>CSS-in-JS allows us to write CSS styles directly in our components' javascript (.js) files.</p>
<p>Not only does it allow you write CSS style rules without having to make a single .css file, but these styles are scoped to individual components.</p>
<p>In other words, you can add, change or remove CSS without any surprises. Changing one component's styles will not impact the styles of the rest of your application.</p>
<p>CSS-in-JS often makes use of a special type of JavaScript function called a tagged template literal. What's great about this is that we can still write plain CSS style rules directly in our JS!</p>
<p>Here's a quick example of a popular CSS-in-JS library, Styled Components:</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> styled <span class="hljs-keyword">from</span> <span class="hljs-string">"styled-components"</span>;

<span class="hljs-keyword">const</span> Button = styled.button<span class="hljs-string">`
  color: limegreen;
  border: 2px solid limegreen;
  font-size: 1em;
  margin: 1em;
  padding: 0.25em 1em;
  border-radius: 3px;

  &amp;:hover {
    opacity: 0.9;
  }
`</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">Button</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">Button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/Screen-Shot-2021-07-14-at-11.18.06-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Note a few things here:</p>
<ol>
<li>You can write normal CSS styles, but can include nested styles and pseudo-classes (like hover).</li>
<li>You can associate styles with any valid HTML element, such as the button element above (see <code>styled.button</code>).</li>
<li>You can create new components with these associated styles. See how <code>Button</code> is used in our App component.</li>
</ol>
<p>Since this is a component, can it be passed props? Yes! We can export this component and use it anywhere in our app we like, plus give it dynamic features through props.</p>
<p>Let's say that you want an inverted variant of <code>Button</code> above with an inverted background and text. No problem.</p>
<p>Pass the <code>inverted</code> prop to our second button and in <code>Button</code>, you can access all props passed to the component using the <code>${}</code> syntax with an inner function. </p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> styled <span class="hljs-keyword">from</span> <span class="hljs-string">"styled-components"</span>;

<span class="hljs-keyword">const</span> Button = styled.button<span class="hljs-string">`
  background: <span class="hljs-subst">${props =&gt; props.inverted ? <span class="hljs-string">"limegreen"</span> : <span class="hljs-string">"white"</span>}</span>;
  color: <span class="hljs-subst">${props =&gt; props.inverted ? <span class="hljs-string">"white"</span> : <span class="hljs-string">"limegreen"</span>}</span>;
  border: 2px solid limegreen;
  font-size: 1em;
  margin: 1em;
  padding: 0.25em 1em;
  border-radius: 3px;

  &amp;:hover {
    opacity: 0.9;
  }
`</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">Button</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">Button</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">Button</span> <span class="hljs-attr">inverted</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">Button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>In the return of the function, you can select the <code>inverted</code> prop and use a ternary to conditionally determine the color of the background and text. </p>
<p>Here is the result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/Screen-Shot-2021-07-14-at-11.31.52-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>There are a great deal more benefits to using a CSS-in-JS library to style your React applications (too many to cover here), some of which I will list below.</p>
<p>Be sure to check out the two most popular CSS-in-JS libraries for React: Emotion and Styled Components.</p>
<p>One downside to using a CSS-in-JS libraries is adding an additional library to your project. However, I would argue this is easily worth the improved developer experience you have when styling your React apps versus plain CSS.</p>
<p>👍 Pros:</p>
<ul>
<li>CSS-in-JS is predictable – styles are scoped to individual components</li>
<li>Since our CSS is now JS, we can export, reuse, and even extend our styles through props</li>
<li>CSS-in-JS libraries ensure there are no styling conflicts by generating unique classnames for your written styles</li>
<li>No need to focus on naming conventions for your classes, just write styles!</li>
</ul>
<p>👎 Cons:</p>
<ul>
<li>Unlike plain CSS, you will need to install one or more third-party JavaScript libraries, which will add weight to your built project</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Note that I did not include component libraries in this comparison. I wanted to focus primarily on different ways to compose styles yourself.</p>
<p>Be aware that choosing a library with pre-made components and styles like Material UI or Ant Design (to name a couple) is a totally valid choice for your project.</p>
<p>I hope this guide gave you a good understanding of how to style your React apps along with which approach to choose for your next project.</p>
<h2 id="heading-become-a-professional-react-developer">Become a Professional React Developer</h2>
<p>React is hard. You shouldn't have to figure it out yourself.</p>
<p>I've put everything I know about React into a single course, to help you reach your goals in record time:</p>
<p><a target="_blank" href="https://www.thereactbootcamp.com"><strong>Introducing: The React Bootcamp</strong></a></p>
<p><strong>It’s the one course I wish I had when I started learning React.</strong></p>
<p>Click below to try the React Bootcamp for yourself:</p>
<p><a target="_blank" href="https://www.thereactbootcamp.com"><img src="https://reedbarger.nyc3.digitaloceanspaces.com/reactbootcamp/react-bootcamp-cta-alt.png" alt="Click to join the React Bootcamp" width="600" height="400" loading="lazy"></a>
<em>Click to get started</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ HTML Italics Tutorial – How to Make Text Italic with the <i> tag ]]>
                </title>
                <description>
                    <![CDATA[ In this article, we are going to learn about how to use the <i> tag and how it differs from the <em> tag.  In previous versions of HTML, the <i> tag was used to display text in italics. But in HTML 5, the definition has changed. We are going ]]>
                </description>
                <link>https://www.freecodecamp.org/news/html-italics-tutorial-how-to-make-text-italic-with-the-i-tag/</link>
                <guid isPermaLink="false">66b8d9c6ce55d3ba4d935997</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Mon, 22 Mar 2021 23:21:42 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/6053020b28094f59be257c71.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In this article, we are going to learn about how to use the <code>&lt;i&gt;</code> tag and how it differs from the <code>&lt;em&gt;</code> tag. </p>
<p>In previous versions of HTML, the <code>&lt;i&gt;</code> tag was used to display text in italics. But in HTML 5, the definition has changed. We are going to explore that new definition and learn about other ways to style text in italics using CSS.  </p>
<h2 id="heading-what-is-the-tag">What is the <i> tag?</i></h2>
<p>The <code>&lt;i&gt;</code> tag, or Idiomatic Text element, is a span of text that represents a change in mood or quality of text. This text is displayed in italics. </p>
<p>Let's look at a few reasons why you might want to use the <code>&lt;i&gt;</code> tag.  </p>
<h3 id="heading-using-the-tag-to-mark-phrases-in-a-different-language">Using the <i> tag to mark phrases in a different language</i></h3>
<p>You can use the <code>&lt;i&gt;</code> tag to mark a span of text in a different language. This example italicizes a latin phrase.  </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Stacy just got a tattoo of the phrase <span class="hljs-tag">&lt;<span class="hljs-name">i</span>&gt;</span>Audentes fortuna iuvat<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> which means "Fortune favors the bold".<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/latin-phrase-tattoo.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can also use the <code>lang</code> attribute in the <code>&lt;i&gt;</code> tag to represent phrases that are in a different language than their surrounding text. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>The first phrase that Matt learned in Italian is <span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"it"</span>&gt;</span>Vorrei una birra<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>, which translates to "I'd like a beer".<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/lang-atrribute.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-using-the-tag-to-show-someones-thoughts">Using the <i> tag to show someone's thoughts</i></h3>
<p>You can also use the <code>&lt;i&gt;</code> tag to highlight a person's inner thoughts. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>After Ben met his girlfriend's parents he thought to himself, <span class="hljs-tag">&lt;<span class="hljs-name">i</span>&gt;</span>I really hope they liked me<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/ben-story.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-using-the-tag-for-the-name-of-a-ship">Using the <i> tag for the name of a ship</i></h3>
<p>If you wanted to use the name of a ship, then you can wrap that name in <code>&lt;i&gt;</code> tags. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>The <span class="hljs-tag">&lt;<span class="hljs-name">i</span>&gt;</span>USS Arizona<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span> was a United States Navy battleship built in the 1910's.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/uss-arizona.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-using-the-tag-for-taxonomic-descriptions">Using the <i> tag for taxonomic descriptions</i></h3>
<p>According to the <a target="_blank" href="https://www.cbd.int/gti/taxonomy.shtml">Convention of Biological Diversity</a>, </p>
<blockquote>
<p>Taxonomy is the science of naming, describing and classifying organisms and includes all plants, animals and microorganisms of the world. </p>
</blockquote>
<p>This would be an example of using the the <code>&lt;i&gt;</code> tag for the term <em>Felis catus</em>. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Another term for the domestic cat would be <span class="hljs-tag">&lt;<span class="hljs-name">i</span>&gt;</span>Felis catus<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/cat-term.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-differences-between-the-tag-and-tag-in-html"><strong>Differences between the <i> tag and <em> tag in HTML</em></i></strong></h2>
<p>You might think that the <code>&lt;i&gt;</code> and <code>&lt;em&gt;</code> tags have the same meaning because they look the same in the browser. But the two tags hold different meanings from each other. </p>
<p>The <code>&lt;em&gt;</code> tag, or emphasis element, should be used when you want to place an emphasis on a word or span of text. </p>
<p>Here is an example using the <code>&lt;em&gt;</code> tag.</p>
<pre><code class="lang-html"> <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Quit being a baby and just <span class="hljs-tag">&lt;<span class="hljs-name">em</span>&gt;</span>do<span class="hljs-tag">&lt;/<span class="hljs-name">em</span>&gt;</span> it already!<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/em-example.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Humans and screen readers would place verbal stress on the word "do". This differs from the <code>&lt;i&gt;</code> tag where there was no extra emphasis placed on the text. </p>
<h2 id="heading-should-you-use-the-tag-for-styling">Should you use the <i> tag for styling?</i></h2>
<p>You should not use the <code>&lt;i&gt;</code> tag for styling purposes. If you want to style text in italics, then you should use the CSS <code>font-style</code> property. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"demo-para"</span>&gt;</span>I am using CSS to style this text in italics.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"><span class="hljs-selector-class">.demo-para</span> {
  <span class="hljs-attribute">font-style</span>: italic;
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/03/css-italics.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-should-you-use-the-or-tag-for-icons">Should you use the <i> or <span> tag for icons?</span></i></h2>
<p>Over the years, there has been debate about whether it is "correct" to use <code>&lt;i&gt;</code> tags or <code>&lt;span&gt;</code> tags for adding icons to your website. </p>
<p>Some will argue that there is nothing wrong with it and it is pretty common practice, while others think it is a misuse of the <code>&lt;i&gt;</code> tag and you should use the <code>&lt;span&gt;</code> tag instead. </p>
<p>Here is a response from <a target="_blank" href="https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use">Font Awesome</a> regarding the use of the <code>&lt;i&gt;</code> for its icons:</p>
<blockquote>
<p>We like the <code>&lt;i&gt;</code> tag for brevity and because most folks use <code>&lt;em&gt;&lt;/em&gt;</code> for emphasized/italicized semantic text these days. If that’s not your cup of tea, using a <code>&lt;span&gt;</code> is more semantically correct.</p>
</blockquote>
<p>My goal is not to make you choose one side over the other in this debate, but rather make you aware of this ongoing discussion. </p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The <code>&lt;i&gt;</code> tag is a span of text that represents a change in mood or quality of text. If you want to place emphasis on text, then the appropriate tag would be the <code>&lt;em&gt;</code> tag.</p>
<p>The <code>&lt;i&gt;</code> tag should not be used for styling purposes. The correct way to style text in italics is to use the CSS <code>font-style</code> property.</p>
<p>I hope you enjoyed this article and learned about when to use <code>&lt;i&gt;</code> tag.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Style Links in CSS ]]>
                </title>
                <description>
                    <![CDATA[ Styling Links Links can be styled with any CSS property, such as color, font-family, font-size, and padding. Here is an easy example: a {     color: hotpink; } In addition, links can be styled differently depending on what state they are in. Links a... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-style-links-in-css/</link>
                <guid isPermaLink="false">66c354f57ef110ecbf367ac8</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 02 Feb 2020 22:53:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9cd9740569d1a4ca3485.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <h2 id="heading-styling-links"><strong>Styling Links</strong></h2>
<p>Links can be styled with any CSS property, such as <code>color</code>, <code>font-family</code>, <code>font-size</code>, and <code>padding</code>. Here is an easy example:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">a</span> {
    <span class="hljs-attribute">color</span>: hotpink;
}
</code></pre>
<p>In addition, links can be styled differently depending on what state they are in.</p>
<p>Links also have 4 states, and many programmers style each state differently. The four states are:</p>
<ul>
<li><code>a:link</code>: an unvisited, unclicked link</li>
<li><code>a:visited</code>: a visited, clicked link</li>
<li><code>a:hover</code>: a link when the user’s mouse is over it</li>
<li><code>a:active</code>: a link when it is clicked</li>
</ul>
<p>The <code>&lt;a href=""&gt;</code> property is responsible for creating URLs and can be modified using a number of CSS styling properties, although it has a few by default:</p>
<ol>
<li>Underline</li>
<li>Blue color</li>
</ol>
<p>You can change these by adding changing the <code>color</code> and <code>text-decoration</code> properties.</p>
<pre><code class="lang-css">   <span class="hljs-selector-tag">color</span>: <span class="hljs-selector-tag">black</span>;
   <span class="hljs-selector-tag">text-decoration</span>: <span class="hljs-selector-tag">none</span>;
</code></pre>
<p>You can also style the link based on interaction using these properties, also known as link states:</p>
<ul>
<li>a:link - a normal, unvisited link</li>
<li>a:visited - a link the user has visited</li>
<li>a:hover - a link when the user mouses over it</li>
<li>a:active - a link the moment it is clicked</li>
</ul>
<p>Here is some sample CSS using the 4 states:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:link</span> { <span class="hljs-attribute">color</span>: red; }
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:visited</span> { <span class="hljs-attribute">color</span>: blue; }
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:hover</span> { <span class="hljs-attribute">color</span>: green; }
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:active</span> { <span class="hljs-attribute">color</span>: blue; }
</code></pre>
<p><strong>Note</strong> that there are some <em>ordering rules</em> for when you are setting the style for link states.</p>
<ul>
<li><code>a:hover</code> MUST come after <code>a:link</code> and <code>a:visited</code></li>
</ul>
<p><code>a:active</code> MUST come after <code>a:hover</code></p>
<p>a:link - a normal, unvisited link a:visited - a link the user has visited a:hover - a link when the user mouses over it a:active - a link the moment it is clicked</p>
<pre><code class="lang-css"><span class="hljs-comment">/* unvisited link */</span>
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:link</span> {
    <span class="hljs-attribute">color</span>: red;
}

<span class="hljs-comment">/* visited link */</span>
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:visited</span> {
    <span class="hljs-attribute">color</span>: green;
}

<span class="hljs-comment">/* mouse over link */</span>
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:hover</span> {
    <span class="hljs-attribute">color</span>: hotpink;
}

<span class="hljs-comment">/* selected link */</span>
<span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:active</span> {
    <span class="hljs-attribute">color</span>: blue;
}
</code></pre>
<h2 id="heading-more-on-styling-in-css">More on styling in CSS:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/inline-css-guide-how-to-style-an-html-tag-directly/">How to style an HTML tag directly in CSS</a> </li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-style-lists-with-css/">How to style lists with CSS</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/a-quick-guide-to-styling-buttons-using-css-f64d4f96337f/">How to style buttons with CSS</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CSS Comment Example – How To Comment Out CSS ]]>
                </title>
                <description>
                    <![CDATA[ Comments are used in CSS to explain a block of code or to make temporary changes during development. The commented code doesn’t execute. Both single and multi-line comments in CSS begin with /* and end with */, and you can add as many comments to you... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/comments-in-css/</link>
                <guid isPermaLink="false">66c3479b4f1fc448a3678fcb</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ CSS3 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 26 Jan 2020 21:57:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9d7b740569d1a4ca3800.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Comments are used in CSS to explain a block of code or to make temporary changes during development. The commented code doesn’t execute.</p>
<p>Both single and multi-line comments in CSS begin with <code>/*</code> and end with <code>*/</code>, and you can add as many comments to your stylesheet as you like. For example:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* This is a single line comment*/</span>
<span class="hljs-selector-class">.group</span><span class="hljs-selector-pseudo">:after</span> {
  <span class="hljs-attribute">content</span>: <span class="hljs-string">""</span>;
  <span class="hljs-attribute">display</span>: table;
  <span class="hljs-attribute">clear</span>: both;
}

<span class="hljs-comment">/*
  This is
  a multi-line
  comment
*/</span>
</code></pre>
<p>You can also make your comments more readable by stylizing them:</p>
<pre><code class="lang-css"><span class="hljs-comment">/*
***
* SECTION FOR H2 STYLE 
***
* A paragraph with information
* that would be useful for someone
* who didn't write the code.
* The asterisks around the paragraph 
* help make it more readable.
***
*/</span>
</code></pre>
<h2 id="heading-organizing-css-with-comments">Organizing CSS with comments</h2>
<p>In larger projects, CSS files can quickly grow in size and become difficult to maintain. It can be helpful to organize your CSS into distinct sections with a table of contents to make it easier to find certain rules in the future:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* 
*  CSS TABLE OF CONTENTS
*   
*  1.0 - Reset
*  2.0 - Fonts
*  3.0 - Globals
*  4.0 - Color Palette
*  5.0 - Header
*  6.0 - Body
*    6.1 - Sliders
*    6.2 - Imagery
*  7.0 - Footer
*/</span>

<span class="hljs-comment">/*** 1.0 - Reset ***/</span>

<span class="hljs-comment">/*** 2.0 - Fonts ***/</span>

<span class="hljs-comment">/*** 3.0 - Globals ***/</span>

<span class="hljs-comment">/*** 4.0 - Color Palette ***/</span>

<span class="hljs-comment">/*** 5.0 - Header ***/</span>

<span class="hljs-comment">/*** 6.0 - Body ***/</span>
<span class="hljs-selector-tag">h2</span> {
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1.2em</span>;
  <span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Ubuntu"</span>, serif;
  <span class="hljs-attribute">text-transform</span>: uppercase;
}

<span class="hljs-comment">/*** 5.1 - Sliders ***/</span>

<span class="hljs-comment">/*** 5.2 - Imagery ***/</span>

<span class="hljs-comment">/*** 7.0 - Footer ***/</span>
</code></pre>
<h2 id="heading-a-little-bit-more-about-css-css-syntax-and-selectors">A little bit more about CSS: <strong>CSS Syntax and Selectors</strong></h2>
<p>When we talk about the syntax of CSS, we’re talking about how things are laid out. There are rules about what goes where, both so you can write CSS consistently and a program (like a browser) can interpret it and apply it to the page correctly.</p>
<p>There are two main ways to write CSS.</p>
<h3 id="heading-inline-css"><strong>Inline CSS</strong></h3>
<p>Specifics on CSS Specificity: <a target="_blank" href="https://css-tricks.com/specifics-on-css-specificity/">CSS Tricks</a></p>
<p>Inline CSS applies styling to a single element and its children, until another style overriding the first is encountered.</p>
<p>To apply inline CSS, add the “style” attribute to an HTML element that you’d like to modify. Inside quotes, include a semicolon-delimited list of key/value pairs (each in turn separated by a colon) indicating styles to set.</p>
<p>Here’s an example of inline CSS. The words “One” and “Two” will have a background color of yellow and text color of red. The word “Three” has a new style that overrides the first, and will have a background color of green and text color of cyan. In the example, we’re applying styles to <code>&lt;div&gt;</code> tags, but you can apply a style to any HTML element.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color:red; background:yellow"</span>&gt;</span>
  One
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    Two
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color:cyan; background:green"</span>&gt;</span>
    Three
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<h3 id="heading-internal-css"><strong>Internal CSS</strong></h3>
<p>While writing an inline style is a quick way to change a single element, there’s a more efficient way to apply the same style to many elements of the page at once.</p>
<p>The internal CSS has its styles specified in the <code>&lt;style&gt;</code> tag, and it is embedded in the <code>&lt;head&gt;</code> tag.</p>
<p>Here’s an example that has a similar effect as the “inline” example above, except the CSS has been extracted to its own area. The words “One” and “Two” will match the <code>div</code> selector and be red text on a yellow background. The words “Three” and “Four” will match the <code>div</code> selector too, but they also match the <code>.nested_div</code> selector which applies to any HTML element that references that class. This more specific selector overrides the first, and they end up appearing as cyan text on a green background.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">style</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span>&gt;</span><span class="css">
  <span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">color</span>: red; <span class="hljs-attribute">background</span>: yellow; }
  <span class="hljs-selector-class">.nested_div</span> { <span class="hljs-attribute">color</span>: cyan; <span class="hljs-attribute">background</span>: green; }
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  One
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    Two
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nested_div"</span>&gt;</span>
    Three
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nested_div"</span>&gt;</span>
    Four
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>The selectors shown above are extremely simple, but they can get quite complex. For example, it’s possible to apply styles only to nested elements; that is, an element that’s a child of another element.</p>
<p>Here’s an example where we’re specifying a style that should only be applied to <code>div</code> elements that are a direct child of other <code>div</code> elements. The result is that “Two” and “Three” will appear as red text on a yellow background, but “One” and “Four” will remain unaffected (and most likely black text on a white background).</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">style</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span>&gt;</span><span class="css">
  <span class="hljs-selector-tag">div</span> &gt; <span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">color</span>: red; <span class="hljs-attribute">background</span>: yellow; }
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  One
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    Two
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    Three
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  Four
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<h3 id="heading-external-css"><strong>External CSS</strong></h3>
<p>All the styling has its own document which is linked in the <code>&lt;head&gt;</code> tag. The extension of the linked file is <code>.css</code></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CSS Naming Conventions that Will Save You Hours of Debugging ]]>
                </title>
                <description>
                    <![CDATA[ By Emmanuel Ohans I have heard lots of developers say they hate CSS. In my experience, this comes as a result of not taking the time to learn CSS. CSS isn’t the prettiest ‘language,’ but it has successfully powered the styling of the web for over 20 ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/css-naming-conventions-that-will-save-you-hours-of-debugging-35cea737d849/</link>
                <guid isPermaLink="false">66d45e46bc9760a197a1038e</guid>
                
                    <category>
                        <![CDATA[ coding ]]>
                    </category>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 16 Jan 2018 23:17:20 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*YunI3ChUVMlpmFzo75FczQ.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Emmanuel Ohans</p>
<p>I have heard lots of developers say they hate CSS. In my experience, this comes as a result of not taking the time to learn CSS.</p>
<p>CSS isn’t the prettiest ‘language,’ but it has successfully powered the styling of the web for over 20 years now. Not doing too badly, huh?</p>
<p>However, as you write more CSS, you quickly see one big downside.</p>
<p>It is darn difficult to maintain CSS.</p>
<p>Poorly written CSS will quickly turn into a nightmare.</p>
<p>Here are a few naming conventions that will save you a bit of stress and countless hours down the line.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0Nm4l3DA3bWTbPc6C4ViWDqewokYYootpoqb" alt="Image" width="650" height="605" loading="lazy">
<em>you’ve been there before, haven’t you?</em></p>
<h3 id="heading-use-hyphen-delimited-strings">Use Hyphen Delimited Strings</h3>
<p>If you write a lot of JavaScript, then writing variables in camel case is common practice.</p>
<pre><code><span class="hljs-keyword">var</span> redBox = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'...'</span>)
</code></pre><p>Great, right?</p>
<p>The problem is that this form of naming isn’t well-suited to CSS.</p>
<p>Do not do this:</p>
<pre><code>.redBox {  <span class="hljs-attr">border</span>: <span class="hljs-number">1</span>px solid red;}
</code></pre><p>Instead, do this:</p>
<pre><code>.red-box {   <span class="hljs-attr">border</span>: <span class="hljs-number">1</span>px solid red;}
</code></pre><p>This is a pretty standard CSS naming convention. It is arguably more readable.</p>
<p>Also, it is consistent with the CSS property names.</p>
<pre><code><span class="hljs-comment">// Correct</span>
</code></pre><pre><code>.some-<span class="hljs-class"><span class="hljs-keyword">class</span> </span>{   font-weight: <span class="hljs-number">10</span>em}
</code></pre><pre><code><span class="hljs-comment">// Wrong</span>
</code></pre><pre><code>.some-<span class="hljs-class"><span class="hljs-keyword">class</span> </span>{   fontWeight: <span class="hljs-number">10</span>em}
</code></pre><h3 id="heading-the-bem-naming-convention">The BEM Naming Convention</h3>
<p>Teams have different approaches to writing CSS selectors. Some teams use hyphen delimiters, while others prefer to use the more structured naming convention called BEM.</p>
<p>Generally, there are 3 problems that CSS naming conventions try to solve:</p>
<ol>
<li>To know what a selector does, just by looking at its name</li>
<li>To have an idea of where a selector can be used, just by looking at it</li>
<li>To know the relationships between class names, just by looking at them</li>
</ol>
<p>Have you ever seen class names written like this:</p>
<pre><code>.nav--secondary {  ...}
</code></pre><pre><code>.nav__header {  ...}
</code></pre><p>That is the BEM naming convention.</p>
<h3 id="heading-explaining-bem-to-a-5-year-old">Explaining BEM to a 5 year Old</h3>
<p>BEM attempts to divide the overall user interface into small reusable components.</p>
<p>Consider the image below:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/pIFVbUmRtKN8x6DvLHEvJeUSM9Oda8ClkY5f" alt="Image" width="800" height="400" loading="lazy">
<em>It is an award winning image of a stick-man :)</em></p>
<p>No, it’s not award winning :(</p>
<p>The stick-man represents a component, such as a block of design.</p>
<p>You may have already guessed that the B in BEM stands for ‘Block’.</p>
<p>In the real world, this ‘block’ could represent a site navigation, header, footer, or any other block of design.</p>
<p>Following the practice explained above, an ideal class name for this component would be <code>stick-man</code>.</p>
<p>The component should be styled like so:</p>
<pre><code>.stick-man {   }
</code></pre><p>We have used delimited strings here. Good!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ThMVqj-sv26pjpzLJU3MIF2TCdn-S4CjlEZk" alt="Image" width="800" height="400" loading="lazy"></p>
<h3 id="heading-e-for-elements">E for Elements</h3>
<p>The E in ‘BEM’ stands for Elements.</p>
<p>Overall blocks of design rarely live in isolation.</p>
<p>For instance, the stick-man has a <code>head</code>, two gorgeous <code>arms</code>, and <code>feet</code>.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/bf2jyOzcZ8wgd95I3qR9IS3Cf6pRlQ2hHuGM" alt="Image" width="800" height="400" loading="lazy"></p>
<p>The <code>head</code> , <code>feet</code>, and <code>arms</code> are all elements within the component. They may be seen as child components, i.e. children of the overall parent component.</p>
<p>Using the BEM naming convention, element class names are derived by adding <strong>two underscores,</strong> followed by the element name.</p>
<p>For example:</p>
<pre><code>.stick-man__head {
</code></pre><pre><code>}
</code></pre><pre><code>.stick-man__arms {
</code></pre><pre><code>}
</code></pre><pre><code>.stick-man__feet {
</code></pre><pre><code>}
</code></pre><h3 id="heading-m-for-modifiers">M for Modifiers</h3>
<p>The M in ‘BEM’ stands for Modifiers.</p>
<p>What if the stick-man was modified and we could have a <code>blue</code> or a <code>red</code> stick- man?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Q-aWWnpw1UuoXxp5NGHxsjP5689VQBT0oGdQ" alt="Image" width="800" height="400" loading="lazy"></p>
<p>In the real world, this could be a <code>red</code> button or <code>blue</code> button. These are modifications of the component in question.</p>
<p>Using BEM, modifier class names are derived by adding two <strong>hyphens</strong> followed by the element name.</p>
<p>For example:</p>
<pre><code>.stick-man--blue {
</code></pre><pre><code>}
</code></pre><pre><code>.stick-man--red {
</code></pre><pre><code>}
</code></pre><p>The last example showed the parent component being modified. This is not always the case.</p>
<p>What if we had stick-men of different <code>head</code> sizes?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ZK-riYJhmFfBVEof6xO8yGGR3O10g2dW7Xqn" alt="Image" width="800" height="400" loading="lazy"></p>
<p>This time the element has been modified. Remember, the element is a child component within the overall containing block.</p>
<p>The <code>.stick-man</code> represents the <code>Block</code> , <code>.stick-man__head</code> the element.</p>
<p>As seen in the example above, double hyphens may also be used like so:</p>
<pre><code>.stick-man__head--small {
</code></pre><pre><code>}
</code></pre><pre><code>.stick-man__head--big {
</code></pre><pre><code>}
</code></pre><p>Again, note the use of the double <strong>hyphens</strong> in the example above. This is used to denote a modifier.</p>
<p>Now you’ve got it.</p>
<p>That’s basically how the BEM naming convention works.</p>
<p>Personally, I tend to use only hyphen delimeter class names for simple projects, and BEM for more involved user interfaces.</p>
<p>You can <a target="_blank" href="http://getbem.com/naming/">read more</a> about BEM.</p>
<p><a target="_blank" href="http://getbem.com/naming/"><strong>BEM - Block Element Modifier</strong></a><br><a target="_blank" href="http://getbem.com/naming/">_BEM - Block Element Modifier is a methodology, that helps you to achieve reusable components and code sharing in the…_getbem.com</a></p>
<h3 id="heading-why-use-naming-conventions">Why Use Naming Conventions?</h3>
<blockquote>
<p>There are only two hard problems in Computer Science: cache invalidation and naming things — <em>Phil Karlton</em></p>
</blockquote>
<p>Naming things is hard. We’re trying to make things easier, and save ourselves time in the future with more maintainable code.</p>
<p>Naming things correctly in CSS will make your code easier to read and maintain.</p>
<p>If you choose to use the BEM naming convention, it will become easier to see the relationship between your design components/blocks just by looking at the markup.</p>
<p>Feeling confident?</p>
<h3 id="heading-css-names-with-javascript-hooks">CSS Names with JavaScript Hooks</h3>
<p>Today is John’s first day at work.</p>
<p>He is handed over an <code>HTML</code> code that looks like this:</p>
<pre><code>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"siteNavigation"</span>&gt;
</code></pre><pre><code>&lt;/div&gt;
</code></pre><p>John has read this article and realizes this may not be the best way to name things in <code>CSS</code>. So he goes ahead and refactors the codebase like so:</p>
<pre><code>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"site-navigation"</span>&gt;
</code></pre><pre><code>&lt;/div&gt;
</code></pre><p>Looks good, huh?</p>
<p>Unknown to John, he had broken the codebase ???</p>
<p>How?</p>
<p>Somewhere in the JavaScript code, there was a relationship with the previous class name, <code>siteNavigation</code>:</p>
<pre><code><span class="hljs-comment">//the Javasript code</span>
</code></pre><pre><code><span class="hljs-keyword">const</span> nav = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.siteNavigation'</span>)
</code></pre><p>So, with the change in the class name, the <code>nav</code> variable became <code>null</code>.</p>
<p>How sad.</p>
<p>To prevent cases like this, developers have come up with different strategies.</p>
<h4 id="heading-1-use-js-class-names">1. Use js- class names</h4>
<p>One way to mitigate such bugs is to use a <code>**js-***</code> class name to denote a relationship with the DOM element in question.</p>
<p>For example:</p>
<pre><code>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"site-navigation js-site-navigation"</span>&gt;
</code></pre><pre><code>&lt;/div&gt;
</code></pre><p>And in the JavaScript code:</p>
<pre><code><span class="hljs-comment">//the Javasript code</span>
</code></pre><pre><code><span class="hljs-keyword">const</span> nav = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.js-site-navigation'</span>)
</code></pre><p>As a convention, anyone who sees the <code>**js-**site-navigation</code> class name would understand that there is a relationship with that DOM element in the JavaScript code.</p>
<h4 id="heading-2-use-the-rel-attribute">2. Use the Rel attribute</h4>
<p>I don’t use this technique myself, but I have seen people do.</p>
<p>Do you recognize this?</p>
<pre><code>&lt;link rel=<span class="hljs-string">"stylesheet"</span> type=<span class="hljs-string">"text/css"</span> href=<span class="hljs-string">"main.css"</span>&gt;
</code></pre><p>Basically, the <strong>rel attribute</strong> defines the relationship that the linked resource has to the document from which it’s referenced.</p>
<p>In the previous example with John, proponents of this technique would do this:</p>
<pre><code>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"site-navigation"</span> rel=<span class="hljs-string">"js-site-navigation"</span>&gt;
</code></pre><pre><code>&lt;/div&gt;
</code></pre><p>And in the JavaScript:</p>
<pre><code><span class="hljs-keyword">const</span> nav = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"[rel='js-site-navigation']"</span>)
</code></pre><p>I have my doubts about this technique, but you’re likely to come accross it in some codebases. The claim here is, <em>“well, there’s a relationship with Javascript, so I use the rel attribute to denote that”</em>.</p>
<p>The web is a big place with lots of different “methods” for solving the same problem.</p>
<h4 id="heading-3-dont-use-data-attributes">3. Don’t use data attributes</h4>
<p>Some developers use data attributes as JavaScript hooks. This isn’t right. By definition, data attributes are used <strong>to store custom data</strong>.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/08r5ESO6cpzZvcZz-KczJEGXtPBtCLorryI6" alt="Image" width="800" height="400" loading="lazy">
<em>Good use of data attributes. As seen on Twitter</em></p>
<p><strong>Edit #1: As mentioned by some amazing people in the comment section, if people use the ‘rel’ attribute, then it’s perhaps okay to use data attributes in certain cases. It’s your call afterall.</strong></p>
<h3 id="heading-bonus-tip-write-more-css-comments">Bonus Tip: Write More CSS Comments</h3>
<p>This has nothing to do with naming conventions, but it will save you some time too.</p>
<p>While a lot of web developers try to NOT write JavaScript comments or stick to a few, I think you should write more CSS comments.</p>
<p>Since CSS isn’t the most elegant “language,” well-structured comments can save time when you’re trying to understand your code.</p>
<p>It doesn’t hurt.</p>
<p>Take a look at how well commented the Bootstrap <a target="_blank" href="https://github.com/twbs/bootstrap/blob/v4-dev/scss/_carousel.scss">source code</a> is.</p>
<p>You do not need to write comments to say <code>color: red</code> will give a red color. But, if you’re using a CSS trick that is less obvious, feel free to write a comment.</p>
<h3 id="heading-ready-to-become-pro">Ready to become Pro?</h3>
<p>I have created a free CSS guide to get your CSS skills blazing, immediately. <a target="_blank" href="https://pages.convertkit.com/0c2c62e04a/60e5d19f9b">Get the free ebook</a>.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/4AqtYrYGSx6s9Mwmzji1vj8RqwvarVns4y7V" alt="Image" width="800" height="533" loading="lazy">
<em>Seven CSS Secrets you didn’t know about</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How Typography Determines Readability: Serif vs. Sans Serif, and How To Combine Fonts. ]]>
                </title>
                <description>
                    <![CDATA[ By Harshita Arora #  For digital design, it’s important to know and understand how to use and how to combine different fonts. There’s a font for every mood! This post is going to give you a quick introduction to the biggest families in Typography: S... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-typography-determines-readability-serif-vs-sans-serif-and-how-to-combine-fonts-629a51ad8cce/</link>
                <guid isPermaLink="false">66c35667cf1314a450f0d69b</guid>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ fonts ]]>
                    </category>
                
                    <category>
                        <![CDATA[ style ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ typography ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 16 Jan 2018 21:55:22 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*jouWgdGEHlsARCuI9iuRDw.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Harshita Arora</p>
<p># </p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/nUU-No03jpFVHrTWqBw94WwQfB5uKgPONxEU" alt="Image" width="800" height="600" loading="lazy"></p>
<p>For digital design, it’s important to know and understand how to use and how to combine different fonts. There’s a font for every mood!</p>
<p>This post is going to give you a quick introduction to the biggest families in Typography: Serif and Sans Serif. And how, as a designer, you can choose the right fonts and combine them.</p>
<p>Let’s start!</p>
<h3 id="heading-serif-type-family">Serif Type Family</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/eaeix2N4fgkoDj0udtUmJy1AxjTeHMp5DOoo" alt="Image" width="209" height="53" loading="lazy">
<em>Example of a Serif font.</em></p>
<p>The typeface Serif is differentiated from Sans Serif by the tiny little feet-like thingy called Serifs.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/u53FoM3ihvScG8u59XLlVrC6ft9xA28hYSvS" alt="Image" width="209" height="53" loading="lazy">
<em>The areas in red are called the serif.</em></p>
<p>A lot of Serif typefaces that you’ll see will look a lot more traditional or conservative.</p>
<p><strong>Origins</strong>: The reason they have these tiny feet is actually because of stone carving. Back in the days when people needed to carve out Latin letters in stone, the designer would usually paint the letters they wanted with a paintbrush. But the stonemasons would have to carve it out from that painting. And that stone carving created these serifs on the letters.</p>
<p>People tend to use Serif typefaces for something quite serious. This is because of their traditional and conservative look and feel.</p>
<p>Serif is further divided into four typeface families.</p>
<h4 id="heading-1-old-style"><em>1. Old</em> <em>Style</em></h4>
<p>This is the oldest Serif family. It includes fonts such as Adobe Jenson, Centaur, Goudy Old style, and many more. Their typeface is modeled on what text used to look like in the 1400s. Very old-looking.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/7erShLB7mzQwdPvahu-zb6Z-jsjfidEYHrN9" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-2-transitional"><em>2. Transitional</em></h4>
<p>This is a bit more modern-looking. This typeface family includes Times New Roman, Baskerville, Georgia, etc.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/dlHWqQNT4qDvdIK400Pd6TGjM740ediuM-2l" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-3-modern"><em>3. Modern</em></h4>
<p>Even more modern-looking and classy-looking. This includes Didot, which is the typeface used for the title of Vogue magazine.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/5gK8e3uBtSdjsIOEfXubM1fqOsVIUIXkdDtt" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-4-slab-serif">4. Slab-Serif</h4>
<p>They’re a type family with thick serifs. Examples of slab-Serif typefaces include American Typewriter, Archer, etc.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ZWOM9ApMDtBsxXShNBQjoHfYhK3lvh-vf3RZ" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<p>Now, how do you differentiate between these four major classes in the Serif Family?</p>
<p>It’s actually quite easy. Look at the first three families: Old style, Transitional, and Modern. Put them side-by-side. If you have a look at the thinnest versus the thickest part of the letters, you’ll see that as you progress from the older to the more modern types. You’ll see an increased difference in what we call the modulation of the typefaces. Concentrate on the O’s for example. Comparing the Old Style to the modern types, the thickness and thinness difference will be lesser compared to Modern.</p>
<p>And a lot of this modulation comes from when people used to write with flat-nibbed pens.</p>
<p>What about Slab-Serif?</p>
<p>If you have a look at a Slab-Serif font, you’ll see there’s pretty much zero difference between the thickest and the thinnest parts of the font.</p>
<p>And it was designed intentionally like this. It’s one of the modern members of the Serif family. Yet, it doesn’t follow the rule of “more into the future you go, the greater the difference between the thickest and thinnest part of the font.” Slab-Serif was created for newspaper printing for clearer reading when the quality of the paper used to be poor.</p>
<h3 id="heading-sans-serif-type-family">Sans-Serif Type Family</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/IVRM3NFH79gUKvhLPeMolpaddVmMm8XPdrQE" alt="Image" width="600" height="400" loading="lazy">
<em>Example of a Sans-Serif font</em></p>
<p>Sans-Serif differs from the Serif. It does not have serifs (the tiny little feet) or any decorative elements along the central beams and the top bars. Sans-Serif is slightly more modern than the serifs.</p>
<p>They’re also subdivided into four families.</p>
<h4 id="heading-1-grotesque"><em>1. Grotesque</em></h4>
<p>The oldest one. This includes News Gothic, Franklin Gothic, and more.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-hlApvxSTW3lg6xZZl1RlmEGROJ8ptDJeRSn" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-2-neo-grotesque"><em>2. Neo-Grotesque</em>:</h4>
<p>Slightly more modern. Helvetica and Ariel are examples.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/NgkPgjVkJ1iD17VupsOBcZxRLzB7Sk2Gzb7M" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-3-humanist"><em>3. Humanist:</em></h4>
<p>Even more in the future. Gill Sans is an example.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/6P6DpKU5Uwzi2P5ItRHksqlR3Eiw3hBTMDY9" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<h4 id="heading-4-geometric"><em>4. Geometric</em>:</h4>
<p>They’re based on geometric shapes. Futura is an example.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/kLWMJzZyH-we9JQzJWD8NjomyuBEs9cteYh7" alt="Image" width="550" height="400" loading="lazy">
_[Image credits](https://www.noupe.com/essentials/icons-fonts/a-crash-course-in-typography-the-basics-of-type.html" rel="noopener" target="<em>blank" title=")</em></p>
<p>How do you differentiate between the four?</p>
<p>Now, similar to the serifs, you can move from the older Grotesque family to the Neo-Grotesque to the Humanist. You can see the difference in the thickest and the thinnest parts of the font get more and more exaggerated. When you look at the Grotesque, it’s almost equidistant at all points. And when you look at the Humanist typefaces, you start to see the variation of the modulation.</p>
<p>In a Geometric typeface, the O’s are always perfectly round. The O’s look exactly like as if you draw with a protractor. And this typeface is a bit like Slab-Serif type. Even though it’s one of the modern typefaces in the family, it bucks the trend and pretty much has no modulation and is equidistant at all points.</p>
<h3 id="heading-how-typography-determines-readability">How Typography Determines Readability</h3>
<p>Having a knowledge of the font families and their subfamilies helps with styling. But more importantly, it’s about readability. Design is both about function and form. What makes a typeface more readable?</p>
<p>Humanist Sans-Serif is considered to be more readable than Grotesque. And the reasons are:</p>
<ul>
<li>Humanist typeface has more open shapes.</li>
<li>The inter-character spacing in the Humanist typeface is more than in Grotesque, making it slightly easier to read.</li>
<li>In the Grotesque typeface, the characters are ambiguous from each other. A lowercase ‘g’ and 9 in Grotesque look pretty similar, they’re all very square, adding more confusion and making it less readable. Whereas in the Humanist typeface, you can clearly differentiate between the characters.</li>
</ul>
<p>These are some factors that make fonts more readable. Now you can choose the typeface depending on the purpose.</p>
<h3 id="heading-how-to-combine-fonts">How to combine fonts</h3>
<p>When you’re combining different typefaces, usually you’ll have a different typeface for the heading and a different one for the body. And this is to create a slight contrast and interest in your designs.</p>
<p>Some of the common rules that designers use when they combine different fonts :</p>
<ol>
<li>The Serifs and Sans-Serif work really well together. It tends to create a good design. Sans-Serif have slightly increased readability compared to Serifs. Which is why Sans-Serif is a great typeface for the body of text.<br>Don’t combine a Serif with a Serif and a Sans-Serif with a Sans-Serif because it can look a little bland and undifferentiated.</li>
<li>Too many fonts in one design is not a good thing. It ends up looking too strange. Stick to 2 fonts (one from Serif family and the other from Sans-Serif).</li>
<li>Appreciate the mood of the typeface just like colors. And don’t combine different moods together. Try to combine more modern fonts with modern fonts and older fonts with more traditional ones.<br>If you get the mood of your typefaces, you start to create some incredibly beautiful designs.<br>Things that you should keep similar: Mood and Time era of the font<br>Things that you should contrast: Serif-ness (for instance, one font should be Serif and the other Sans-Serif) and Weights.<br>Weight means how heavy or bold your text is. Most design software have a whole range of weights. For example, light, medium, bold, extra bold, and so on. Play around with different weights contrasting them to create interesting designs.</li>
</ol>
<p>NEVER EVER use — Comic Sans, Papyrus, Viner, Kristen, Curlz. No matter what you’re designing, they’ll make your designs look terrible.</p>
<h3 id="heading-tools-for-typography">Tools for Typography</h3>
<ol>
<li><a target="_blank" href="https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm?hl=en">WhatFont</a><br>A chrome extension that tells you the name of a font on any website.</li>
<li><a target="_blank" href="https://www.fontsquirrel.com/">Font Squirrel</a><br>I usually download fonts from here. They’re free for commercial use.</li>
</ol>
<p>That was a brief overview of the vast field of typography. Hope you learned interesting things that you can use in your designs! :)</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
