<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ojebiyi Fulness</title>
    <description>The latest articles on DEV Community by Ojebiyi Fulness (@jebbs).</description>
    <link>https://dev.to/jebbs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1174934%2Fb587e173-7586-4a7f-8983-234fcaf1b40c.jpeg</url>
      <title>DEV Community: Ojebiyi Fulness</title>
      <link>https://dev.to/jebbs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jebbs"/>
    <language>en</language>
    <item>
      <title>React 18: The Features and The Future</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Sat, 07 Oct 2023 18:28:39 +0000</pubDate>
      <link>https://dev.to/jebbs/react-18-the-features-and-the-future-nbm</link>
      <guid>https://dev.to/jebbs/react-18-the-features-and-the-future-nbm</guid>
      <description>&lt;h2&gt;
  
  
  React 18: The Features and The Future
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;All about the exciting release of React 18 and exploring its new features&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mYI5kAAx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2100/0%2AC0SrRkJF1iUY6JEs" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mYI5kAAx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2100/0%2AC0SrRkJF1iUY6JEs" alt="Image by [Gerrard Cooper](https://www.codementor.io/@gerrardcooper14) on [Codementor](https://www.codementor.io/@gerrardcooper14/react-18-things-you-need-to-know-about-react-js-latest-version-1i608b94my)" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The web development space is in a constant state of evolution, with technologies needing to adapt to frequent changes. In this dynamic environment, there is an ever-increasing demand for greater efficiency and optimized performance. Popular frameworks like React have evolved over the years to meet these demands, providing developers with enhanced tools for productivity and effectiveness. In this article, we’ll look at the latest development in the React ecosystem and the benefits it brings for both developers and users alike.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What is React?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React v18.0&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to upgrade to React 18&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt;: This will be a lengthy read, so grab your juice, relax on your couch and let’s get this going. 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  What is React?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/React_(software)"&gt;React also known as React JS&lt;/a&gt; is a popular open-source JavaScript library for building user interfaces. React helps developers create interactive and dynamic web applications through the use of a &lt;a href="https://medium.com/@ojebiyifulness/5-main-features-of-react-js-that-developers-must-know-759e222d3699"&gt;component-based architecture and a virtual DOM&lt;/a&gt;. This means that the user interface is broken down into reusable and self-contained building blocks. React helps build fast and modern web applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/React_(software)#History"&gt;React was developed by Facebook in 2011 and released to the public in 2013.&lt;/a&gt; React 16.0 was released in September 2017, while React 17.0 was released in August 2020. On March 29, 2022, React 18 was released, which introduced new features.&lt;/p&gt;

&lt;h2&gt;
  
  
  React v18.0
&lt;/h2&gt;

&lt;p&gt;As earlier stated, on March 29, 2022, React 18 was rolled out with some key updates and new features. React 18 is focused on improving the performance of React applications and concurrent rendering features. You can check out the official release document &lt;a href="https://react.dev/blog/2022/03/29/react-v18"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is an improvement to concurrency in React and new features added, which include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Automatic Batching&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transitions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Suspense on the server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New Strict Mode Behaviors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New Hooks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ll look at these improvements and features in detail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concurrent React
&lt;/h3&gt;

&lt;p&gt;Concurrent React is a feature that allows applications to stay responsive and gracefully adjust to varying workloads and priorities. It helps React prioritize updates and rendering based on the importance and urgency of different tasks, ensuring that high-priority updates are processed more quickly.&lt;/p&gt;

&lt;p&gt;In previous versions of React, once rendering started, it could not be interrupted until it was completed.&lt;/p&gt;

&lt;p&gt;Dan Abramov from the React 18 working group discussions gives &lt;a href="https://github.com/reactwg/react-18/discussions/46"&gt;a good example&lt;/a&gt; that simplifies the concept of concurrency.&lt;/p&gt;

&lt;p&gt;Let’s say we need to call two people, Bob and Alice. In a non-concurrent setting, we’ll place the calls to each of them one after the other; that is, I call Bob first, and after ending the call with him, I call Alice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0HaILaZB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3616/0%2ArAMe76lMZfURIlPs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0HaILaZB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3616/0%2ArAMe76lMZfURIlPs.png" alt="Image showing a non-concurrent phone conversation. A conversation has to end before another begins. Image from the [React 18 working group discussions](https://github.com/reactwg/react-18/discussions/46)" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s imagine a scenario where we are talking with Alice and an urgent call from Bob comes in. We put the call with Alice on hold and then answer the more urgent call from Bob before going back to our call with Alice. This is what concurrency is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iikYK1eO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3160/0%2AvwSVswA4bYVB41eB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iikYK1eO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3160/0%2AvwSVswA4bYVB41eB.png" alt="Image showing a concurrent phone conversation; A conversation is put on hold in favour of a more urgent one. Image from the [React 18 working group discussions](https://github.com/reactwg/react-18/discussions/46)" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In React 18, React can either interrupt, pause, or resume a render. It can even go as far as abandoning it to quickly respond to user interactions. It does not matter the magnitude of the task at hand; when there is a more urgent task, React will treat that as a priority.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic Batching
&lt;/h3&gt;

&lt;p&gt;Automatic batching is one of the features of React 18. To understand batching, &lt;a href="https://github.com/reactwg/react-18/discussions/46#discussioncomment-846694"&gt;an example&lt;/a&gt; is given from the React 18 working group discussion. Let’s say five of your friends are around on a visit, and you want to get food for them from a nearby restaurant. To ensure your trip is efficient, you get a list of what each person wants to eat, take a trip to the restaurant, and buy the food, all in a single trip. This is batching.&lt;/p&gt;

&lt;p&gt;Without batching, you would get the order of the first person, go to the restaurant, purchase the food, and come back to take the order of the second person, go to the restaurant, purchase the food... until you do so for the last person. You would be so frustrated.&lt;/p&gt;

&lt;p&gt;React uses batching to group multiple state updates into a single re-render for better performance. By doing this, unnecessary re-renders are avoided. Previously, React batched state updates in event handlers during browser events, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setAlert&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="nx"&gt;setAlert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="c1"&gt;// React re-renders once at the end. This is batching!&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;classname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-blue &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-black&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, there were some exceptions to this, such as updating the state after an event has been handled. For example, if you need to fetch data and then update the state in the event handler &lt;code&gt;handleClick&lt;/code&gt; above, React would not batch the updates but do them independently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setAlert&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// React re-renders this!&lt;/span&gt;
    &lt;span class="nx"&gt;setAlert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// React re-renders this!&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;classname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-blue &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-black&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/reactwg/react-18/discussions/21"&gt;Updates inside of promises, setTimeout, native event handlers, or any other event were not batched in React by default.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In React 18, &lt;a href="https://github.com/reactwg/react-18/discussions/5"&gt;&lt;code&gt;createRoot&lt;/code&gt;&lt;/a&gt; helps to automatically batch all updates, irrespective of whether they are in event handlers or not.&lt;/p&gt;

&lt;p&gt;Automatic batching comes with React 18. &lt;code&gt;UseReactDOM.flushSync()&lt;/code&gt; to opt out of batching.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transitions
&lt;/h3&gt;

&lt;p&gt;Transition is a newly introduced feature that helps React distinguish urgent from non-urgent updates.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Urgent updates&lt;/strong&gt; are from the direct interaction of the user, such as pressing, typing, clicking, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transition updates&lt;/strong&gt; or non-urgent updates switch the UI from one view to another.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Transition ensures that the user interface remains responsive even during a re-render. For example, you may have done this before. You click a button, and before the information is fully loaded, you change your mind and click on another button to do another task.&lt;/p&gt;

&lt;p&gt;What did you notice? The action you took caused the user interface to freeze briefly. This happens when the state update is not set to a transition. Transition interrupts an ongoing render in favour of a more urgent one.&lt;/p&gt;

&lt;p&gt;Updates are marked with the &lt;code&gt;useTransition()&lt;/code&gt; hook. Here’s an example of how transition works, as adapted from the React blog.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;SlidesContainer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isPending&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useTransition&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;slide&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSlide&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;about&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;selectSlide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextSlide&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setSlide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextSlide&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, the React blog explains what &lt;code&gt;isPending&lt;/code&gt; and  do.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The &lt;code&gt;*isPending*&lt;/code&gt; flag that tells you whether there is a pending transition.”&lt;br&gt;
 “The &lt;code&gt;*startTransition*&lt;/code&gt; function that lets you mark a state update as a transition”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;startTransition&lt;/code&gt; function can be used to start transitions whenever the &lt;code&gt;useTransition()&lt;/code&gt; hook cannot be used. Here’s an example from the React blog.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;startTransition&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Urgent: Show what was typed&lt;/span&gt;
&lt;span class="nx"&gt;setInputValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Mark any state updates inside as transitions&lt;/span&gt;
&lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Transition: Show the results&lt;/span&gt;
  &lt;span class="nx"&gt;setSearchQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can learn more about transitions in &lt;a href="https://react.dev/reference/react/useTransition"&gt;the transition documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Suspense on the Server
&lt;/h3&gt;

&lt;p&gt;When rendering your client-side application, you first fetch the HTML of the page from the server and the required JavaScript resources necessary to run the page. However, if you’re faced with challenges such as a large JavaScript bundle size or a slow network connection, delays occur, preventing the user from effectively interacting with the page.&lt;/p&gt;

&lt;p&gt;Server-side rendering (SSR) takes care of this and ensures the user experience is enjoyable.&lt;/p&gt;

&lt;p&gt;Server rendering, also known as server-side rendering (SSR), is a web development technique where a web server processes a request for a web page and generates the initial HTML content. This HTML is sent to the user’s browser, which can then render the page faster since it already has some content to display.&lt;/p&gt;

&lt;p&gt;This is done while JavaScript content is still loading, hence, the pages are static and will only become interactive after the necessary JavaScript contents have loaded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=pj5N-Khihgc"&gt;Shaundai Person’s React Conf 2021 talk&lt;/a&gt; gives a detailed overview of client vs. server-side rendering.&lt;/p&gt;

&lt;p&gt;Previously, in React, one slow component meant the entire page would also render slowly. There was no way you could tell React to defer the loading of a slow component. This caused bottlenecks in React apps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6rEfj5EN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3888/0%2At0Ai1ZO9ZwPVsH2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6rEfj5EN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3888/0%2At0Ai1ZO9ZwPVsH2n.png" alt="In client rendering, a user has to wait for some time before the page becomes interactive. [Source](https://www.youtube.com/watch?v=pj5N-Khihgc): React Conf 2021 **Streaming Server Rendering with Suspense** by Shaundai Person" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In React 18, you can “suspend” slow parts or components of your app by wrapping them in the Suspense components. For example, you can show a loading state for a component that would take a bit of time to load.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As explained on the React blog, “&lt;strong&gt;suspense&lt;/strong&gt; lets you declaratively specify the loading state for a part of the component tree if it’s not yet ready to be displayed”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When a component is “suspended”, it means it is not ready to load, so HTML is sent directly from the server to display on the page while the component gets ready to be displayed. The user is then able to see a skeleton of the page immediately before it gradually loads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mxB3hboL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A4dn0BZoc_w3tjqZz.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mxB3hboL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A4dn0BZoc_w3tjqZz.jpeg" alt="In server rendering, we can display meaningful data to the user much faster by sending HTML from the server. [Source](https://www.youtube.com/watch?v=pj5N-Khihgc): React Conf 2021 **Streaming Server Rendering with Suspense** by Shaundai Person" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since HTML is lightweight, it is displayed before JavaScript; hence, there will be HTML components on display while the JavaScript components are gradually loading, improving the user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  New Strict Mode Behaviours
&lt;/h3&gt;

&lt;p&gt;In React 18, strict mode will simulate the mounting, unmounting, and remounting of components with a previous state. What does this mean? For example, when a user tabs away from a screen and back, the previous screen should be immediately seen. I’ll explain the process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When the user gets to the screen at first, React mounts the component&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When the user tabs away from the screen, React dismounts the component&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When the user goes back to the screen, React mounts the component again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is done over and over again. Strict mode will make sure that components are not affected by being mounted and unmounted over and over again.&lt;/p&gt;

&lt;h3&gt;
  
  
  New Hooks
&lt;/h3&gt;

&lt;p&gt;React 18 introduces new hooks, such as&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://react.dev/reference/react/useId"&gt;&lt;code&gt;useId()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://react.dev/reference/react/useTransition"&gt;&lt;code&gt;useTransition()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://react.dev/reference/react/useDeferredValue"&gt;&lt;code&gt;useDeferredValue()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://react.dev/reference/react/useSyncExternalStore"&gt;&lt;code&gt;useSyncExternalStore()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://react.dev/reference/react/useInsertionEffect"&gt;&lt;code&gt;useInsertionEffect()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can read more about them.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Upgrade to React 18
&lt;/h3&gt;

&lt;p&gt;To install React 18 and React DOM from npm, type this in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you’re using yarn, type the following into your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, you’ll use &lt;code&gt;createRoot&lt;/code&gt; instead of &lt;code&gt;render&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In your index.js file, update &lt;code&gt;ReactDOM.render&lt;/code&gt; to &lt;code&gt;ReactDOM.createRoot&lt;/code&gt; to create a root and render your app using root.&lt;/p&gt;

&lt;p&gt;In React 17, this was the format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// render app to ReactDOM directly&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In React 18, this has been updated to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// create a root&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//render app to root&lt;/span&gt;
&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your React app will continue to be recognized as version 17 until you apply the updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Whew! That was quite a lot, and so much more. These improvements and features in React bode well for developers and users alike. It ensures a smoother developer's experience and eliminates performance bottlenecks, leading to faster React applications.&lt;/p&gt;

&lt;p&gt;The user experience has also been improved. No more looking at blank screens waiting for the components of a page to load (hehehe). There’s also improved interactivity and seamless running of tasks for the users. So, this is a win-win situation. The future of React looks very bright. Long may React continue!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Tailwind CSS vs. Styled-Components for Styling in React JS</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Fri, 06 Oct 2023 07:45:54 +0000</pubDate>
      <link>https://dev.to/jebbs/tailwind-css-vs-styled-components-for-styling-in-react-js-13ed</link>
      <guid>https://dev.to/jebbs/tailwind-css-vs-styled-components-for-styling-in-react-js-13ed</guid>
      <description>&lt;p&gt;&lt;em&gt;Knowing each framework, their features, and the right one to choose for your React project&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TYWqpQdr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzur3qk1cr8m1qs7k4rx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TYWqpQdr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzur3qk1cr8m1qs7k4rx.png" alt="Designed on Canva by the author" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever visited a poorly designed website and wondered what you were doing there? I have, and I didn’t enjoy the experience. Those kinds of websites put you off.&lt;/p&gt;

&lt;p&gt;This is why creating aesthetically pleasing web pages and applications is essential in web development for a good user experience. This leads to greater interactivity and engagement, hence more lead conversion.&lt;/p&gt;

&lt;p&gt;CSS, or Cascading Style Sheets, is the main tool for styling web pages. We’ll consider the differences between two popular CSS libraries: Tailwind CSS and Styled Components. You’ll get to know the main features of each library and which one to choose for your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What CSS libraries and frameworks are&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What Tailwind CSS and Styled-Components are&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Features of Tailwind CSS and Styled-Components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Which framework should you choose?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Styled Components are mainly used in the React ecosystem, so you need to have knowledge of React to be able to use it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tailwind does not require prior knowledge of React, JavaScript, or even CSS to be used to create custom components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you’re familiar with Bootstrap, you’ll be able to pick up Tailwind CSS relatively easily.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tailwind CSS is categorized as a framework but is sometimes referred to as a library because it is different from other CSS frameworks. In this article, we’ll be referring to it as a framework.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What are CSS libraries and frameworks?
&lt;/h2&gt;

&lt;p&gt;CSS libraries are collections of pre-written CSS styles and components that you can include in your project. They are modular, meaning you can pick and choose specific styles or components to use rather than adopting the entire framework.&lt;/p&gt;

&lt;p&gt;CSS frameworks are comprehensive packages that include a set of predefined styles, layout systems, components, and often JavaScript functionality. They provide a structured and fixed way to build web interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS and Styled-Components
&lt;/h2&gt;

&lt;p&gt;Tailwind CSS is a &lt;a href="https://xenox.dev/tailwind-css-utility-first-css-framework/"&gt;utility-first CSS framework&lt;/a&gt;. It provides a set of &lt;a href="https://tailwindcss.com/docs/utility-first"&gt;pre-defined utility classes&lt;/a&gt; that you can apply directly to your HTML elements to style them. Tailwind CSS promotes a declarative approach to styling, where you describe the styles you want directly in your HTML markup.&lt;/p&gt;

&lt;p&gt;Styled Components is a &lt;a href="https://en.wikipedia.org/wiki/CSS-in-JS"&gt;CSS-in-JS&lt;/a&gt; library that allows you to write your CSS styles using JavaScript within your React components. It supports a more component-focused approach to styling, where you create Styled Components as reusable building blocks for your User Interface (UI).&lt;/p&gt;

&lt;h2&gt;
  
  
  Features of Tailwind CSS and Styled Components
&lt;/h2&gt;

&lt;p&gt;Here, we proceed to look at some features of these two wonderful styling tools.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Features of Tailwind CSS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You write styles in the HTML markup by applying classes to elements, such as shown below:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-white rounded-md 
          bg-orange-400 font-medium px-4 py-3 text-center cursor-pointer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nx"&gt;Get&lt;/span&gt; &lt;span class="nx"&gt;started&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above specifies the button should have white text on an orange background with a normal font thickness, a padding of 16 pixels on the left and right axes, and 12 pixels on the top and bottom axes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can customize utility classes, colors, fonts, and more from the configuration file that comes with the Tailwind installation. You can extend or modify the default configuration to suit your project’s needs, as shown below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/** @type {import('tailwindcss').Config} */&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;screens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;md&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;950px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#fe9446&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bronze&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#98582a&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;base&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#fff4f2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;origin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#fb9333&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;gridTemplateColumns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;footer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2fr repeat(2, 1.2fr) 1.5fr  2fr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tailwind CSS primarily focuses on individual utility classes rather than creating reusable components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tailwind CSS helps developers create a consistent way to style elements, making it easy for them to work with pre-defined classes. This improves the developer experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Features of Styled Components
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You write styles using JavaScript template literals within your React components; that is, you define a styled component and use it as a normal React component, as shown below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: #fb923c; 
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: center;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


 &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Get&lt;/span&gt; &lt;span class="nx"&gt;started&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Styles are defined directly in the JavaScript files. You write the styles yourself from scratch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styled Components are designed to create reusable components that can be used throughout your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styled Components offer a more dynamic and programmatic approach to styling, making it flexible and easy to retain control over the codebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Right Framework to Choose
&lt;/h2&gt;

&lt;p&gt;Now, a bit of the author’s story (haha). I started using styled components near the end of 2021 and throughout 2022 until March 2023.&lt;/p&gt;

&lt;p&gt;I first discovered Tailwind CSS when a more experienced developer noticed that I was coding slowly. I decided to give it a try, and I haven’t regretted that decision. Tailwind CSS has significantly increased my coding speed. If a situation arises where Styled Components are needed, I wouldn’t hesitate to use them again. Also, Tailwind CSS provides better performance as compared to CSS-in-JS frameworks.&lt;/p&gt;

&lt;p&gt;Despite its many advantages, Tailwind CSS can become cluttered due to the sheer number of classes it generates if not handled properly, which many developers don’t. I’ve encountered difficulties with this in the past, but I’m getting better at structuring it. On the other hand, Styled Components help maintain tidy project files and code, offering greater control over the overall structure when compared to Tailwind CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As a final piece of advice, it is better to select a framework based on the type of project.&lt;/p&gt;

&lt;p&gt;For small-scale projects or those that require speed, Tailwind CSS would be a better option. Personally, there’s just something exciting about crafting styles alongside the elements themselves.&lt;/p&gt;

&lt;p&gt;For projects that would need a lot of maintenance and control from the developer, it is better to use Styled Components. It is also necessary in projects where you have a lot of &lt;a href="https://coursework.vschool.io/dynamic-rendering-in-react/"&gt;dynamic rendering&lt;/a&gt;, &lt;a href="https://developer.chrome.com/articles/css-nesting/"&gt;nested styling&lt;/a&gt;, and reusable components.&lt;/p&gt;

&lt;p&gt;Below are some resources that you may find useful:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/docs/installation"&gt;https://tailwindcss.com/docs/installation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://styled-components.com/docs"&gt;https://styled-components.com/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://css-tricks.com/a-thorough-analysis-of-css-in-js/"&gt;https://css-tricks.com/a-thorough-analysis-of-css-in-js/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/dailyjs/what-is-actually-css-in-js-f2f529a2757"&gt;https://medium.com/dailyjs/what-is-actually-css-in-js-f2f529a2757&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.dhiwise.com/post/styled-components-vs-tailwind-css-finding-the-perfect-style-for-your-react-project"&gt;https://www.dhiwise.com/post/styled-components-vs-tailwind-css-finding-the-perfect-style-for-your-react-project&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>react</category>
      <category>styledcomponents</category>
    </item>
    <item>
      <title>5 Main Features of React JS That Developers Must Know</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Thu, 05 Oct 2023 11:05:44 +0000</pubDate>
      <link>https://dev.to/jebbs/5-main-features-of-react-js-that-developers-must-know-48i8</link>
      <guid>https://dev.to/jebbs/5-main-features-of-react-js-that-developers-must-know-48i8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hvvvIGU0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3200/0%2Ay6IcBe5J1AdALzXw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hvvvIGU0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3200/0%2Ay6IcBe5J1AdALzXw.png" alt="Image from [Subhampreet Mohanty](https://dev.to/subhampreet) on [dev.to](https://dev.to/spectrumcetb/beginner-s-guide-to-react-js-15lm)" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the ever-evolving field of web development, it is essential to be ahead of the crowd. With rising user expectations and constantly advancing technology, developers need tools that empower them to create dynamic and responsive user interfaces effectively. Here is where React JS comes in.&lt;/p&gt;

&lt;p&gt;What is React JS? React JS, or React, is an open-source JavaScript library developed and maintained by Facebook. It was designed with a singular purpose - to build user interfaces (UIs) that are both efficient and easy to develop and maintain.&lt;/p&gt;

&lt;p&gt;In this article, we explore five main features of React JS that underpin its popularity and effectiveness and make it the most popular JavaScript library. Whether you’re a seasoned developer looking to expand your toolkit or someone just stepping into the field of front-end development, understanding what React brings to the table is pivotal.&lt;br&gt;
   &lt;/p&gt;
&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Virtual DOM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSX&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Component-Based Structure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One-way Data Binding&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Performance and Simplicity&lt;br&gt;
   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  1. Virtual DOM
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Document_Object_Model"&gt;Document Object Model&lt;/a&gt; (DOM) is like a structured map of a web page. It is the interface in programming that allows programs (like web browsers) to understand, access, and update the content, structure, and style of a webpage. The Virtual DOM is the representation of the real DOM. When there are changes or modifications to the web app, the Virtual DOM is updated and checked for differences from the real DOM. If there are any, the DOM will update only the part that has changed, while leaving the unchanged part the same. This makes React very fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hEEV9vm4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2ADR4xwUAzPllrzpEU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hEEV9vm4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2ADR4xwUAzPllrzpEU.png" alt="Image by [Swarnali Roy](https://dev.to/swarnaliroy94) on [dev.to](https://dev.to/swarnaliroy94/introduction-to-react-real-dom-virtual-dom-363)" width="800" height="540"&gt;&lt;/a&gt;&lt;br&gt;
   &lt;/p&gt;
&lt;h2&gt;
  
  
  2. JSX
&lt;/h2&gt;

&lt;p&gt;JSX is JavaScript Syntax Extension, or JavaScript XML. It is a syntax that allows the combination of HTML and JavaScript in coding. It enables developers to use HTML in JavaScript easily. It helps to convert HTML tags to elements in React. It is optional but very popular with developers. It is named with the extension .jsx. Below is an example of JSX syntax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;HeroSection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Component-Based Structure
&lt;/h2&gt;

&lt;p&gt;React is built on the logic of components. It is all about components. React allows developers to split the User Interface (UI) into independent and reusable components. These components are like building blocks that can be assembled to create complex user interfaces. This promotes code reusability and maintainability. Components always start with capital letters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qZKG0zS---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AM31Ts-6hqA4XnIwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qZKG0zS---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AM31Ts-6hqA4XnIwi.png" alt="Component-based architecture. From J[avatpoint](https://www.javatpoint.com/react-components)" width="600" height="500"&gt;&lt;/a&gt;&lt;br&gt;
   &lt;/p&gt;

&lt;h2&gt;
  
  
  4. One-way Data Binding
&lt;/h2&gt;

&lt;p&gt;React logic flows in one direction. That’s how it was designed. This is called one-way data binding. The data flows from top to bottom only, i.e., from the parent elements to the child elements. Having data flow in one direction gives better control and increases efficiency because data is constrained in only one direction. This makes it easier to understand how data changes propagate through the application, making debugging and maintenance more straightforward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TUvjcNwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2ATuXsnFjm3Cb8Xkjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TUvjcNwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2ATuXsnFjm3Cb8Xkjl.png" alt="One-way data binding. Image by Ravindra Savaram on [Mindmagix](https://mindmajix.com/introduction-to-react-js)" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
   &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Extensions
&lt;/h2&gt;

&lt;p&gt;React supports server-side rendering and mobile app development. React uses extensions to aid application building, such as Redux, Flux, and React Native, and others. React Native makes it possible for React to be used in mobile app development. With React Native, you can use React concepts and components to build native mobile applications for iOS and Android platforms, sharing a significant amount of code between platforms.&lt;/p&gt;

&lt;p&gt;These features are some of the key reasons why React.js is widely used in modern web development for creating dynamic and interactive user interfaces. Understanding how these features work will make a React developer stand out and have access to better opportunities.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>coding</category>
    </item>
    <item>
      <title>Beginner’s Guide to Frontend Web Development — Part 3</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Wed, 04 Oct 2023 08:17:28 +0000</pubDate>
      <link>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-3-4gl3</link>
      <guid>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-3-4gl3</guid>
      <description>&lt;p&gt;&lt;em&gt;Exploring the intricacies of JavaScript for interaction and dynamism&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4rvLT3jN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3440/0%2ARljh-DignzpyFxj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4rvLT3jN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3440/0%2ARljh-DignzpyFxj6.png" alt="Image by Omar Waleed on [Toptal](https://www.toptal.com/nodejs/benchmark-nodejs-promise)" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last part of this series on the introduction to front-end web development, we’ll look at a very fundamental tool, probably the most important if you aim to build interactive and engaging websites for users.&lt;/p&gt;

&lt;p&gt;In this article, we will be introduced to JavaScript. In all your interactions with webpages, you must have heard of or come across JavaScript in use and probably wonder what it does. We’ll look at the intricacies of JavaScript in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript: The Tool for Interaction and Dynamism&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;History of JavaScript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding JavaScript to HTML&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript Syntax&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript in use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript Frameworks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JavaScript: The Tool for Interaction and Dynamism
&lt;/h2&gt;

&lt;p&gt;When you fill out and submit a form on a webpage, have you thought about what handles the form submission? Or when you want to switch between light and dark modes, do you ever wonder, “What makes this work?” These questions and more are answered by one word. JavaScript.&lt;/p&gt;

&lt;p&gt;JavaScript is a scripting language that is used to make webpages “come alive”. It is used to improve a website’s functionality, making it more interactive and dynamic. JavaScript is the powerhouse that performs actions such as submitting a form and getting a response, displaying updates to content, basically, anything that makes a website more interesting and purposeful to interact with.&lt;/p&gt;

&lt;h2&gt;
  
  
  History of JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript was created in 1995 by Brendan Eich. It was initially developed for the Netscape Navigator, a popular web browser at the time. JavaScript was made an ECMA standard in 1997.&lt;/p&gt;

&lt;p&gt;JavaScript is formally known as ECMAScript. The latest version of ECMAScript is ES6 (abbreviated). There have been further updates every year from 2016 to the current updated version of ES6, which is ES14, as of June 2023.&lt;/p&gt;

&lt;p&gt;JavaScript and Java are two different languages. Though they have similar syntax, they are very different from one another in design and application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding JavaScript to HTML
&lt;/h2&gt;

&lt;p&gt;JavaScript can be incorporated into HTML texts using the script tag in either the head or body tags. It is bad practice to use the script tag at the bottom of the body tag.&lt;/p&gt;

&lt;p&gt;JavaScript files must be saved in .js format to import them with the script tag to HTML, e.g. script.js, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, 
        initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"script.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  JavaScript Syntax
&lt;/h2&gt;

&lt;p&gt;JavaScript is a scripting language, therefore it is written differently from HTML and CSS.&lt;/p&gt;

&lt;p&gt;JavaScript is case-sensitive; for example, &lt;strong&gt;frame&lt;/strong&gt; is different from &lt;strong&gt;Frame&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript doesn’t read any meaning to whitespace.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript defines two value types, which are literals and variables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The use of semicolons to terminate lines of code in JavaScript is not compulsory but is advisable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript supports comments both on a single line and spanning several lines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JavaScript identifiers are characters used to identify a variable, function, or keyword. It can only start with an underscore, a dollar sign, or a letter (uppercase or lowercase).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JavaScript in Practice
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Variable
&lt;/h3&gt;

&lt;p&gt;A variable can be described as a store of data. It is the value that is assigned to an identifier. There are two ways to define a variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Using let : This allows you to assign a new value to an already-defined value&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using const : This defines a constant value. A new value can’t be assigned to it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A variable can also be undeclared. These kinds of variables will be declared when they’re used. Demonstrating the use of variables in an external JavaScript file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sW_rtXSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A--OJIvxN03ws8kK7qPJmUQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sW_rtXSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A--OJIvxN03ws8kK7qPJmUQ.png" alt="" width="712" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code on line 6 above targets a paragraph tag with the “output” id in the HTML document and displays the result there.&lt;/p&gt;

&lt;p&gt;The result of the javascript code is shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7D1DAtuf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2566/1%2AT43Xq7dR3wyNCD8NBq-g8A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7D1DAtuf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2566/1%2AT43Xq7dR3wyNCD8NBq-g8A.png" alt="" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Function
&lt;/h3&gt;

&lt;p&gt;A function is a block of JavaScript code that is designed to perform a particular task. A function in practice will be demonstrated below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// let a = 52;&lt;/span&gt;
      &lt;span class="c1"&gt;// let b = 76;&lt;/span&gt;
      &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;output&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The sum of both numbers is &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give the result shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B7qVX1Ub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2696/1%2AQtan85wvDekDa6ZyoZCLwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B7qVX1Ub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2696/1%2AQtan85wvDekDa6ZyoZCLwg.png" alt="" width="800" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice the &lt;a href="https://www.w3schools.com/js/js_comments.asp"&gt;commented-out&lt;/a&gt; part inside the function? If the comment slash is removed, the values of a and b inside the function will replace those declared outside the function, and the result will be 128 as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VF7Kl1GY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2586/1%2A1DxjaF0HVG7JpQArfzJ74Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VF7Kl1GY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2586/1%2A1DxjaF0HVG7JpQArfzJ74Q.png" alt="" width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The values of a and b declared outside the function are called global variables, and they will be applied at every instance called in any function. You can override global variables if they are reassigned inside the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript Frameworks
&lt;/h2&gt;

&lt;p&gt;JavaScript frameworks are libraries that are written in JavaScript code to provide an easier development process for software developers. Building coding projects with HTML, CSS, and vanilla JavaScript from scratch takes a lot of time to complete. It also involves writing a lot of code.&lt;/p&gt;

&lt;p&gt;JavaScript frameworks help developers build complex apps faster and easier. Read more about frameworks &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;JavaScript frameworks are numerous, and examples include React, Angular, Vue, and Svelte, among others.&lt;/p&gt;

&lt;p&gt;Learning a framework is a necessity as a frontend developer because a lot of companies require it and it helps in the faster and less strenuous building of projects.&lt;/p&gt;

&lt;p&gt;For a deeper insight into JavaScript, the following platforms will be of use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/js/default.asp"&gt;https://www.w3schools.com/js/default.asp&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This guide has covered the basics of the tools needed to kick-start a career in front-end web development.&lt;/p&gt;

&lt;p&gt;Frontend web development is a lucrative field with room for flexibility and upskilling. There is room to apply your creative potential in great working conditions. Moreover, having tech skills will ensure an individual is better placed for a future filled with technological innovations.&lt;/p&gt;

&lt;p&gt;Having a deep understanding of how these different languages work will make you very valuable in the frontend development field, provide access to the best opportunities, and reward you financially. Cool, isn’t it?&lt;/p&gt;

&lt;p&gt;Have an exciting and wonderful tech journey ahead!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn"&gt;https://developer.mozilla.org/en-US/docs/Learn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Beginner’s Guide to Frontend Web Development — Part 2</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Tue, 03 Oct 2023 08:05:10 +0000</pubDate>
      <link>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-2-1jaj</link>
      <guid>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-2-1jaj</guid>
      <description>&lt;p&gt;&lt;em&gt;Exploring the role of Cascading Style Sheets (CSS) in creating stunning webpages&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QVxxp8PS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4400/0%2AHkstu7Uy3oLAKXA7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QVxxp8PS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4400/0%2AHkstu7Uy3oLAKXA7.png" alt="Image by Stefan Vitasovic on [Toptal](https://www.toptal.com/css/full-page-slider-css-and-javascript)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the previous section of this guide, we talked about what frontend web development is all about and the tools to get you started in your web development journey. In this article, we will talk about the second tool you need, CSS.&lt;/p&gt;

&lt;p&gt;What is CSS? Why do I need it? You may ask. Well, this is precisely what we will discuss in this article. Prepare your mind for an exciting journey. Whoohoo!&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;CSS: The Styling and Layout Tool&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;History of CSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding CSS to HTML pages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS Syntax&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS in practical application&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  CSS: The Styling and Layout Tool
&lt;/h2&gt;

&lt;p&gt;Take a look at the webpage below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mUzZHxg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2562/1%2AY0uQZ-N5QVTgfkfXJ-_cXQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mUzZHxg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2562/1%2AY0uQZ-N5QVTgfkfXJ-_cXQ.png" alt="Webpage built with HTML only" width="800" height="767"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Beautiful, right? Negative! This is the result of building our webpage with HTML only. Just imagine if all websites were designed with HTML only; then, we'd have a bunch of unattractive, clustered pieces of elements lumped together. This shows the need for CSS.&lt;/p&gt;

&lt;p&gt;CSS is used to define how a webpage’s layout should look. It is used to add styling to an HTML document, instructing the web browser how to display HTML elements. CSS makes websites appealing to the eye, well-organized, and have a solid structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  History of CSS
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt; is the abbreviation for &lt;strong&gt;Cascading Style Sheets&lt;/strong&gt;. It was first introduced by Håkon Wium Lie in 1994. CSS 3, the current version, was released in 2005 with several updates.&lt;/p&gt;

&lt;p&gt;There are different methods of styling web pages. They include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Using the style tag in the head or body tag&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using an external stylesheet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using inline styles.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The recommended method for styling is using an external stylesheet. It guarantees better code and leaner, uncluttered files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding CSS to an HTML Document
&lt;/h2&gt;

&lt;p&gt;To link a CSS file to HTML, the CSS file must first be saved in the .css format, e.g. style.css. A link to the CSS file is provided using the link element, which is a component of the metadata inside the head tag, and the href attribute, as shown below, to link to the file name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, 
      initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the HTML document can be styled. Hurray!&lt;/p&gt;




&lt;h2&gt;
  
  
  CSS Syntax
&lt;/h2&gt;

&lt;p&gt;The format of writing CSS code is very different from that of HTML. CSS code is written in a &lt;strong&gt;selector-declaration&lt;/strong&gt; format. The &lt;strong&gt;declaration&lt;/strong&gt; comprises two parts: a &lt;strong&gt;property&lt;/strong&gt; and a &lt;strong&gt;value&lt;/strong&gt;. This is demonstrated below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rSocnPa---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AoHusgDCCllrhg2zKVutdjg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rSocnPa---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AoHusgDCCllrhg2zKVutdjg.png" alt="CSS selector-declaration syntax" width="522" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The background-color and text-color properties of the body selector are both set to a grey value in the example above. The biggest heading is set to red. As the stylesheet has been linked to the HTML file containing the heading examples, the changes will be reflected on the webpage, as seen below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sYXOCPom--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AUnB-d0vHCYyJG_8V7WXArg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sYXOCPom--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AUnB-d0vHCYyJG_8V7WXArg.png" alt="Order of text headings from the biggest (h1) to the smallest (h6). h1 has been given a red colour." width="679" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Easy.&lt;/p&gt;

&lt;p&gt;Selectors are very powerful. A selector can be used to target all instances of a particular tag in HTML and give it the same formatting. For example in the code snippet below, there are three paragraph and div tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the first paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the second paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the third paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason for styling with CSS is to change the background colour of the div tags to gray and the text colour of the paragraph tag to blue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result in the browser is shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZQBUADbf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2604/1%2Aa2GlhtdB4Ef-hGpfyZRBUw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZQBUADbf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2604/1%2Aa2GlhtdB4Ef-hGpfyZRBUw.png" alt="Paragraph tags nested inside div tags and styled with CSS." width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These styles will be used for all div and p tags in the document until a higher hierarchy of specificity overrides them.&lt;/p&gt;

&lt;p&gt;Specificity is likened to a kind of hierarchy for which style will be applied to an element when multiple rules target it.&lt;/p&gt;

&lt;p&gt;CSS supports shorthand forms of properties. A shorthand form of a property allows for the application of different properties under that property at the same time.&lt;/p&gt;




&lt;h2&gt;
  
  
  CSS in Practice
&lt;/h2&gt;

&lt;p&gt;In this section, some examples of CSS styling will be shown&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS Font and Typography
&lt;/h3&gt;

&lt;p&gt;Font deals with the specific styling and appropriate sizing of text. There are several properties for styling text with font. They are &lt;code&gt;font-family&lt;/code&gt;, &lt;code&gt;font-weight&lt;/code&gt;, &lt;code&gt;font-stretch&lt;/code&gt;, &lt;code&gt;font-style&lt;/code&gt;, &lt;code&gt;font-size&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;An example of these in use is shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Courier New'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Courier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;monospace&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-stretch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;extra-condensed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;italic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Applying these styles to the p tag from the previous example will give the result below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7sbXd7W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2454/1%2AOmLF4T2WwFH7W_IlDTvgmQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7sbXd7W2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2454/1%2AOmLF4T2WwFH7W_IlDTvgmQ.png" alt="Paragraph tags nested inside div tags and styled with CSS." width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apart from fonts, several properties can be used to style text. Some of them include text-decoration, text-align, text-transform,letter-spacing, text-shadow.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS Box Model
&lt;/h3&gt;

&lt;p&gt;In CSS, every element is in a box form. The box model deals with sizing elements based on CSS properties. A visualization of the box model as shown by Chrome is shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qNJIgEg6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AGSt_4qEUxSw3JMHFPvnjPw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qNJIgEg6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AGSt_4qEUxSw3JMHFPvnjPw.png" alt="Visualization of the box model. Image by writer" width="554" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are four parts to the box model, moving from the outside to the inner part.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The area of the content: The area outside and around the margin&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Margin: This is a CSS property used to create space around an element&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Border: This is a CSS property used to draw a defined perimeter around elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Padding: This is a CSS property used to create space in the inner part of an element&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using the paragraph example from above, the way these properties work will be shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;        &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The &lt;strong&gt;px&lt;/strong&gt; short form of &lt;strong&gt;pixel&lt;/strong&gt;, is a unit used in measurement in CSS and is the most commonly used. It works based on some convention that makes it consistent across several devices. There are some other units of measurement, such as &lt;strong&gt;percentage&lt;/strong&gt;, &lt;strong&gt;relative units&lt;/strong&gt; such as em, rem, and &lt;strong&gt;viewport units&lt;/strong&gt; such as vh, vw, among others.&lt;/p&gt;

&lt;p&gt;The above code will give this result in the browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NvPLxqof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2556/1%2AgeTpKnKVw4GedwVb3x7X6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NvPLxqof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2556/1%2AgeTpKnKVw4GedwVb3x7X6g.png" alt="Elements arranged in CSS box model" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the snippet that contains the CSS code above,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The padding of 4px for both elements is used to create space between the element and the border.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The margin of 10px for both elements is used to create space around the outer part of the border.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The border with a thick, solid line of 2px is used to separate the padding and the margin.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information on CSS and an in-depth study, The following links will be of tremendous assistance in teaching more about the basic and advanced components of CSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/css/default.asp"&gt;https://www.w3schools.com/css/default.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Beginner’s Guide to Frontend Web Development — Part 1</title>
      <dc:creator>Ojebiyi Fulness</dc:creator>
      <pubDate>Sun, 01 Oct 2023 23:00:00 +0000</pubDate>
      <link>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-1-4mb6</link>
      <guid>https://dev.to/jebbs/beginners-guide-to-frontend-web-development-part-1-4mb6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H_ONj_wr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4aq0nk98m4iosdaatdp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H_ONj_wr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4aq0nk98m4iosdaatdp0.png" alt="Image from Escape Authority" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Web development is the design and development of web pages.&lt;/p&gt;

&lt;p&gt;A webpage is a visual representation of a document written in HTML on a web browser. It is the part of the website that users can view and interact with, such as submitting a form, checking an image gallery, or using a social media platform. This is also called the frontend.&lt;/p&gt;

&lt;p&gt;A front-end developer’s job is to build the user-interactive elements of a website or an application. This article will serve as a helpful guide for anyone interested in becoming a fantastic web developer. Let us start this adventure together.&lt;/p&gt;

&lt;p&gt;This guide is in three parts, the first of which will be considered here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;p&gt;The following sections will be considered in this guide.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;HTML: The Backbone of a Webpage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;History of HTML&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML Syntax&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML Tags&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML in use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  HTML: The Backbone of a Webpage
&lt;/h2&gt;

&lt;p&gt;Imagine the human body: smooth and beautiful skin with all the muscles and flesh in perfect condition… there’s just one issue: there are no bones. Even though the external components are perfect, there’s no structure - which is the skeleton - to hold them in place.&lt;/p&gt;

&lt;p&gt;As the skeleton is to the human body, so is HTML to a webpage. HTML is the building block of a webpage. It is the language in which documents are written and determines how they appear on a website.&lt;/p&gt;




&lt;h2&gt;
  
  
  History of HTML
&lt;/h2&gt;

&lt;p&gt;HTML is fully written as HyperText Markup Language. It was created by Tim Berners-Lee in 1993.&lt;/p&gt;

&lt;p&gt;Markup language refers to a system of encoded texts having a set of symbols inserted in a text document to control its structure, formatting, or the relationship between its parts.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTML Syntax
&lt;/h2&gt;

&lt;p&gt;In programming, syntax is a set of guidelines that specify how code in a language should be written.&lt;/p&gt;

&lt;p&gt;HTML code is written in tags. When the browser serves an HTML page, it interprets the tags’ functions and renders the elements according to the rules that define their visual appearance.&lt;/p&gt;

&lt;p&gt;HTML code consists of three parts. An HTML element is the sum of these parts. The parts of an element include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Opening Tag&lt;/strong&gt;: This defines where the code starts. It is wrapped inside the open and close angle brackets &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Text&lt;/strong&gt;: This consists of two parts. The first is the text that defines how the tag will be displayed on a webpage. The second is the information that the tag will display.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Closing Tag&lt;/strong&gt;: This defines where the code ends. It has the same structure as the closing tag but with the addition of a forward slash &lt;code&gt;&amp;lt;/&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using this structure to display paragraph text, we have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I identify as a paragraph, amigo!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nested elements
&lt;/h3&gt;

&lt;p&gt;These are elements that can contain other elements. Nesting is a characteristic common to all HTML documents. An example is shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;H1 is the largest heading&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hello! I'm the first paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hello! I'm the second paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few key points to remember when writing HTML code include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;All HTML documents should always end with a .html extension&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All HTML documents must start with a &amp;lt;!DOCTYPE html&amp;gt; declaration. This makes the browser identify it as an HTML document.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nested elements should be indented with 2 or 4 characters, as shown in the example above. Indentation is a space that is put at the beginning of a line of code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML tags are not case-sensitive; that is, they can be written in uppercase or lowercase format.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  HTML Tags
&lt;/h2&gt;

&lt;p&gt;Categories of HTML tags include:&lt;/p&gt;

&lt;p&gt;a. Heading Tags&lt;/p&gt;

&lt;p&gt;b. Body Tags&lt;/p&gt;

&lt;h3&gt;
  
  
  Heading Tags
&lt;/h3&gt;

&lt;p&gt;These tags define the characteristics of an HTML document. These tags include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The&lt;/strong&gt; &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; &lt;strong&gt;tag&lt;/strong&gt;&lt;br&gt;
This is a container for the metadata of a page. Metadata is information about the data in a web document. The head tag contains some tags, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The&lt;/strong&gt; &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; &lt;strong&gt;tag&lt;/strong&gt;
This tag is used to write JavaScript in an HTML document, as shown below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;minus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The&lt;/strong&gt; &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; &lt;strong&gt;tag&lt;/strong&gt;
This tag is used to write CSS styles in an HTML document, as shown below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The&lt;/strong&gt; &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; &lt;strong&gt;tag&lt;/strong&gt;
This tag is used to define the page’s metadata, as shown below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width,
    initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;First HTML Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Body Tags
&lt;/h3&gt;

&lt;p&gt;These tags display the part of the webpage that the user can see.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The&lt;/strong&gt; &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; &lt;strong&gt;tag&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It contains all the tags that define a page’s content. An HTML document can only contain one body tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two categories of elements in the body tag are:&lt;/p&gt;

&lt;p&gt;a. &lt;strong&gt;Block elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These elements take up the full width of the line they are written on. They do not permit any other element to be placed beside them. Think of it as a president’s podium. No one shares it with him/her. Examples include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;figcaption&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;figure&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;hr&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;aside&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;output&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;blockquote&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;form&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;fieldset&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;-&lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;pre&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;video&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example of block elements in practice will be shown using the heading tags.&lt;/p&gt;

&lt;p&gt;The heading tags are represented by the &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; tags. These tags are ranked from most important to least important.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Largest Heading&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Second Largest Heading&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Third Largest Heading&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;Fourth Largest Heading&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;Fifth Largest Heading&lt;span class="nt"&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;Smallest Heading&lt;span class="nt"&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s how the headings are displayed in the browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6oB9dVTF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1lc8rsmacay8xdepz81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6oB9dVTF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1lc8rsmacay8xdepz81.png" alt="The arrangement of headings: from the biggest to the smallest&amp;lt;br&amp;gt;
" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To demonstrate why these are block elements, rearranging the order of the headings as shown below gives the same result&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Largest Heading&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Second Largest Heading&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt; 
  &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Third Largest Heading&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;Fourth Largest 
  Heading&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;Fifth Largest Heading&lt;span class="nt"&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;Smallest Heading&lt;span class="nt"&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;b. &lt;strong&gt;Inline elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These elements can stay next to each other on a line, hence the name inline elements. They are way more accommodating compared to body tags (hehehe!). Examples include the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;abbr&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;em&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;sub&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;acronym&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;select&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;sup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;cite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;small&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;textarea&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The button tag is used to define a button that can be clicked on in the webpage. It is used to show an example of inline elements in practice below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Hello! It's me&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;I'm another button&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Another one!&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;  
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will be displayed in the browser as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ye-mlFRj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xm82ne8qwfegckiwr8y3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ye-mlFRj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xm82ne8qwfegckiwr8y3.png" alt="The buttons remain on the same line despite the separate lines in the code. A feature of inline elements.&amp;lt;br&amp;gt;
" width="800" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The buttons remain on the same line despite the separate lines in the code. A feature of inline elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTML Attributes
&lt;/h3&gt;

&lt;p&gt;These snippets provide more information about HTML documents. They are usually defined in the opening tag and come in key/value pairs. The syntax is key=”value”.&lt;/p&gt;

&lt;p&gt;The two most common attributes are:&lt;/p&gt;

&lt;p&gt;a. &lt;strong&gt;Class attribute&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This defines one or several class names for an HTML element. There can be multiple class names for an element, separated by a space.&lt;/p&gt;

&lt;p&gt;b. &lt;strong&gt;Id attribute&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This defines a special identifier for a particular HTML element. There can only be one id used for each element, and it cannot be duplicated.&lt;/p&gt;

&lt;p&gt;Furthermore, HTML has various elements for structuring and organizing the webpage, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text-formatting elements&lt;/li&gt;
&lt;li&gt;Quotation elements&lt;/li&gt;
&lt;li&gt;List elements&lt;/li&gt;
&lt;li&gt;Container elements&lt;/li&gt;
&lt;li&gt;Page Structuring elements&lt;/li&gt;
&lt;li&gt;Form Elements&lt;/li&gt;
&lt;li&gt;Link elements&lt;/li&gt;
&lt;li&gt;Image elements&lt;/li&gt;
&lt;li&gt;Multimedia tags&lt;/li&gt;
&lt;li&gt;Iframes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information on these elements and a more in-depth look into HTML, check out these links:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/html/default.asp"&gt;https://www.w3schools.com/html/default.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML"&gt;https://developer.mozilla.org/en-US/docs/Web/HTML&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This article has covered the basics of HTML, which is one of the tools needed to kickstart a career in front-end web development.&lt;/p&gt;

&lt;p&gt;Learning HTML is the first step on your way to becoming an awesome front-end web developer.&lt;/p&gt;

&lt;p&gt;Do well to check out the second part of this guide, which gives a comprehensive introduction to CSS. See ya!&lt;/p&gt;

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