<?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>Forem: Jomagene</title>
    <description>The latest articles on Forem by Jomagene (@jomagene).</description>
    <link>https://forem.com/jomagene</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%2F1118058%2F952169da-c9d9-41e6-9887-aa0670d7ee60.jpg</url>
      <title>Forem: Jomagene</title>
      <link>https://forem.com/jomagene</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jomagene"/>
    <language>en</language>
    <item>
      <title>Comparing Frontend Technologies: ReactJS vs. Pure HTML, CSS, and JavaScript</title>
      <dc:creator>Jomagene</dc:creator>
      <pubDate>Sat, 29 Jun 2024 21:51:27 +0000</pubDate>
      <link>https://forem.com/jomagene/comparing-frontend-technologies-reactjs-vs-pure-html-css-and-javascript-3ofb</link>
      <guid>https://forem.com/jomagene/comparing-frontend-technologies-reactjs-vs-pure-html-css-and-javascript-3ofb</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Hey there! If you're diving into &lt;strong&gt;frontend development&lt;/strong&gt;, you’ve probably come across a bunch of different tools and frameworks. Today, I want to chat about two different approaches: using &lt;strong&gt;ReactJS&lt;/strong&gt; and sticking with the basics—pure &lt;strong&gt;HTML, CSS, and JavaScript&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Recently, while working on a project with a friend, she asked me, “Why bother with React when we can quickly get the job done using just HTML, CSS, and JavaScript?” &lt;br&gt;
I laughed but realized it’s a great question. Every developer faces this dilemma at some point: why choose one technology over another? So, let’s dive into the comparison and see what each approach offers, with a sprinkle of humor along the way.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is ReactJS?
&lt;/h3&gt;

&lt;p&gt;ReactJS is like the cool kid in the JavaScript world. Created by Facebook, it helps developers build user interfaces, especially for single-page applications where data changes more often than the weather.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Features of ReactJS:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Component-Based Architecture&lt;/strong&gt;: Imagine building your UI like a LEGO set. React lets you snap together reusable components, making your code more organized and easier to manage.&lt;br&gt;
&lt;strong&gt;Virtual DOM&lt;/strong&gt;: Instead of updating the actual DOM (which can be as slow as a Monday morning), React updates a virtual version first, speeding things up.&lt;br&gt;
&lt;strong&gt;Declarative Syntax&lt;/strong&gt;: You just describe what you want your UI to look like, and React takes care of the nitty-gritty details.&lt;br&gt;
&lt;strong&gt;Rich Ecosystem&lt;/strong&gt;: There’s a ton of libraries and tools that work with React, so you can find a solution for almost any problem. It’s like having a Swiss Army knife for web development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pure HTML, CSS, and JavaScript
&lt;/h3&gt;

&lt;p&gt;On the flip side, developing with pure HTML, CSS, and JavaScript means you’re writing everything from scratch. It’s like cooking a gourmet meal without pre-made ingredients—you have total control, but it’s a lot of work!&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Features of Pure HTML, CSS, and JavaScript:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Direct Control&lt;/strong&gt;: You have complete control over every aspect of your web application. It's like being the king or queen of your code kingdom.&lt;br&gt;
&lt;strong&gt;Simplicity&lt;/strong&gt;: This approach is perfect for small projects or static websites where you don’t need the extra weight of a framework.&lt;br&gt;
Performance: With no extra layers, your site can be as fast as a cheetah on espresso.&lt;br&gt;
&lt;strong&gt;Fundamental Knowledge&lt;/strong&gt;: Mastering these core technologies is essential for any web developer. It's like learning to ride a bike before driving a car.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparing ReactJS and Pure HTML, CSS, and JavaScript
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Development Speed&lt;/strong&gt;: React’s reusable components can speed up development, especially for bigger projects. Pure HTML, CSS, and JavaScript might take more time to manage as your project grows, like trying to juggle flaming torches.&lt;br&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: React is built to handle large, dynamic applications easily. Pure HTML, CSS, and JavaScript can get tricky to maintain as your project scales, like trying to keep a house of cards from falling.&lt;br&gt;
Learning Curve: React has a bit of a learning curve because of its ecosystem and concepts like JSX and hooks. Pure HTML, CSS, and JavaScript are the basics every web developer should know—like the ABCs of web development.&lt;br&gt;
&lt;strong&gt;Maintenance&lt;/strong&gt;: React’s modular approach makes it easier to update and maintain your code. Pure HTML, CSS, and JavaScript can become more error-prone and harder to manage in larger codebases, like trying to herd cats.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Experience with ReactJS
&lt;/h3&gt;

&lt;p&gt;I’ve spent a lot of time working with ReactJS, and I’ve really come to appreciate its power and efficiency. The ability to create reusable components and manage state effectively has changed the way I build web applications. Plus, the React community is super active, which means there’s always a new tool or resource to help you out. It’s like being part of a massive, nerdy family.&lt;/p&gt;

&lt;h3&gt;
  
  
  Expectations for HNG Internship
&lt;/h3&gt;

&lt;p&gt;As part of the HNG Internship, I’m excited to sharpen my ReactJS skills, work with other talented developers, and get involved in some cool projects. This internship is a fantastic opportunity to learn best practices from industry experts and apply them to real-world scenarios. I can’t wait to see what we’ll build together!&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Both ReactJS and pure HTML, CSS, and JavaScript have their strengths. ReactJS is great for building complex, dynamic applications, while pure HTML, CSS, and JavaScript offer simplicity and control, perfect for smaller projects.&lt;/p&gt;

&lt;p&gt;If you’re interested in learning more about the HNG Internship, check out these links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hng.tech/internship" rel="noopener noreferrer"&gt;HNG Internship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hng.tech/hire" rel="noopener noreferrer"&gt;HNG Hire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Call to Action
&lt;/h3&gt;

&lt;p&gt;I’d love to hear your thoughts on ReactJS versus pure HTML, CSS, and JavaScript. Which do you prefer and why? Drop a comment below and let’s chat! Let’s make this a fun conversation—after all, we’re all here to learn and grow together.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Journey Through the Digital Cosmos: The Internet Vs the World Wide Web</title>
      <dc:creator>Jomagene</dc:creator>
      <pubDate>Mon, 06 May 2024 01:36:52 +0000</pubDate>
      <link>https://forem.com/kaliacad/journey-through-the-digital-cosmos-unraveling-the-mysteries-of-the-internet-and-the-world-wide-web-g94</link>
      <guid>https://forem.com/kaliacad/journey-through-the-digital-cosmos-unraveling-the-mysteries-of-the-internet-and-the-world-wide-web-g94</guid>
      <description>&lt;p&gt;In the vast expanse of technological innovation, the terms "Internet" and "World Wide Web" are often used interchangeably, creating an illusion of synonymity. However, for us, the trailblazers in the realm of technology, particularly those who have navigated the initial labyrinth of confusion, distinguishing between these terms is not merely a matter of semantics—it forms the cornerstone of our understanding as we architect and engage with digital systems. So, let's embark on an enlightening odyssey to elucidate and distinguish these pivotal concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Internet: The Lifeline of Global Connectivity
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmqld4de0498em6ncmpgi.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmqld4de0498em6ncmpgi.jpeg" alt="The illustration of The internet as a lifeline of global connectivity" width="640" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Internet, a formidable structure birthed from the visionary ARPANET project of the 1960s, is the global network that underpins all forms of data exchange and connectivity. It's the dynamo powering everything from email correspondences and secure banking transactions to multiplayer online gaming and the marvel of cloud computing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The World Wide Web: The Gateway to the Information Universe
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcu7excliucbsjshkqf0i.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcu7excliucbsjshkqf0i.jpeg" alt="Image illustrating the web as a connection of documents and media" width="640" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conceived from Tim Berners-Lee’s revolutionary vision in 1991, the Web transformed the intricate infrastructure of the Internet into an accessible and user-friendly platform. It’s built on HTTP, the protocol that weaves documents and media from around the globe into a seamlessly navigable experience, enabling us to traverse websites and applications with the ease of a click.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distinguishing the Digital Titans
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Chronology and Purpose&lt;/strong&gt;: The Internet’s infrastructure was firmly established decades before the Web spun its first hyperlink. Their core missions diverge: the Internet was engineered as a communication powerhouse, while the Web was devised to make accessing and sharing information intuitive and immediate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical Foundations&lt;/strong&gt;: While the Internet operates on a diverse array of protocols (TCP/IP, SMTP, FTP), the Web primarily dwells in the domain of HTTP and HTML, the standards for web pages that we develop and interact with daily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functionality in Practice&lt;/strong&gt;: When you send an email, stream a podcast, or engage in an FTP session, you’re harnessing the power of the Internet. But when you’re browsing through sites on Chrome or Firefox, you’re navigating the labyrinth of the World Wide Web.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bridging Concepts for Technologists
&lt;/h2&gt;

&lt;p&gt;For us, the pioneers in the tech field, understanding the Internet and the Web as distinct yet interconnected entities is crucial. The Internet provides the infrastructure—the grand stage upon which the drama of the Web unfolds. The Web, with its user-friendly interfaces and protocols, makes this infrastructure accessible and beneficial for the general public, and indeed for us as technologists when crafting new solutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febw1t6hfcdu4ls8qm9av.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febw1t6hfcdu4ls8qm9av.png" alt="Image illustrating the integral roles both the Internet and the Web play in our modern digital landscape." width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By understanding the nuanced yet distinct roles of the Internet and the World Wide Web, we can better navigate and innovate within this space, ensuring we leverage each component effectively to enhance our development practices and end-user experiences. This foundational knowledge isn't merely academic—it's a critical pillar in our continuous journey as technologists in the perpetually evolving tech cosmos.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>web</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Navigating the Stormy Waters of Git Merge Conflicts: A Guide for basic git conflicts</title>
      <dc:creator>Jomagene</dc:creator>
      <pubDate>Sat, 20 Apr 2024 21:08:48 +0000</pubDate>
      <link>https://forem.com/kaliacad/navigating-the-stormy-waters-of-git-merge-conflicts-a-complete-guide-38n9</link>
      <guid>https://forem.com/kaliacad/navigating-the-stormy-waters-of-git-merge-conflicts-a-complete-guide-38n9</guid>
      <description>&lt;p&gt;Merge conflicts in Git can feel like a sudden storm in the calm seas of coding. They disrupt the work flow and can be intimidating for both new and experienced developers alike. However, with the right knowledge and tools, resolving these conflicts can be straightforward and even become a routine part of a developer’s workflow. In this guide, we'll explore the nature of merge conflicts, how to effectively resolve them, and best practices to minimize their occurrence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Merge Conflicts
&lt;/h2&gt;

&lt;p&gt;A merge conflict occurs when Git is unable to automatically resolve differences in code between two commits. This typically happens when two branches have made edits to the same line of a file or when one branch deletes a file while another modifies it. For developers working in teams, conflicts are a common scenario, especially in large projects with frequent updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Scenarios Leading to Merge Conflicts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simultaneous Edits:&lt;/strong&gt; Two branches modify the same part of the same file differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletions and Modifications:&lt;/strong&gt; One branch deletes a file while another branch is making changes to it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Divergent Branch Strategies:&lt;/strong&gt; Long-running branches that diverge significantly from the main branch can lead to complex conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Resolve Merge Conflicts
&lt;/h3&gt;

&lt;p&gt;When a conflict occurs, Git will pause the merge process, allowing you to manually resolve the issues. The steps to handle a merge conflict can be outlined as follows:&lt;/p&gt;

&lt;p&gt;1 . &lt;strong&gt;Identify Conflicted Files:&lt;/strong&gt;&lt;br&gt;
   Use the command &lt;code&gt;git status&lt;/code&gt; to list the files with conflicts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 . &lt;strong&gt;Examine the Differences:&lt;/strong&gt;&lt;br&gt;
   Open the conflicted file and you will see markers that delineate the conflicting changes:&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;&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="na"&gt;HEAD&lt;/span&gt;
   &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="na"&gt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;contact : email.support@github.com&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   =======
   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   please contact us at support@github.com
   &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; iss53
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the &lt;code&gt;HEAD&lt;/code&gt; pointer shows the current branch version, and the &lt;code&gt;iss53&lt;/code&gt; marks the incoming branch version.&lt;/p&gt;

&lt;p&gt;3 . &lt;strong&gt;Resolve the Conflicts:&lt;/strong&gt;&lt;br&gt;
   Edit the file to merge the changes manually. This may involve choosing one side's changes, merging elements of both sides, or writing new code.&lt;/p&gt;

&lt;p&gt;4 . &lt;strong&gt;Mark the Conflict as Resolved:&lt;/strong&gt;&lt;br&gt;
   Use &lt;code&gt;git add&lt;/code&gt; to stage the resolved file. This signals to Git that the conflict has been dealt with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;git add &amp;lt;file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5 . &lt;strong&gt;Complete the Merge:&lt;/strong&gt;&lt;br&gt;
   With all conflicts resolved and the changes staged, use &lt;code&gt;git commit&lt;/code&gt; to complete the merge. Git will present a default commit message detailing the merge, which you can modify if necessary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;git commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tools for Resolving Conflicts
&lt;/h3&gt;

&lt;p&gt;For those who prefer a visual approach, several tools can facilitate the resolution process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Built-in tools like git mergetool:&lt;/strong&gt; Launches a graphical tool to help resolve conflicts. Popular tools include Meld, Beyond Compare, and KDiff3.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nv"&gt;$ &lt;/span&gt;git mergetool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IDEs and Editors:&lt;/strong&gt; Most integrated development environments (IDEs) and code editors like Visual Studio Code, IntelliJ IDEA, and Atom provide GUI-based conflict resolution features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Best Practices to Avoid Merge Conflicts
&lt;/h3&gt;

&lt;p&gt;While conflicts are sometimes inevitable, the following strategies can minimize their frequency and severity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frequent Commits:&lt;/strong&gt; Smaller, more frequent commits can reduce the complexity of merges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular Pulls:&lt;/strong&gt; Regularly pulling changes from the main branch into feature branches keeps branches up-to-date and minimizes divergence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communication:&lt;/strong&gt; Coordinate with team members when working on the same files or features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch Management:&lt;/strong&gt; Keep branch lifetimes short and integrate changes regularly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Merge conflicts in Git, while challenging, are a manageable aspect of collaborative software development. Understanding how to effectively resolve these conflicts ensures that development processes run smoothly and efficiently. With the right strategies and tools, developers can turn the daunting task of resolving merge conflicts into a simple routine, allowing the team to focus on what they do best: building great software.&lt;/p&gt;




</description>
      <category>git</category>
      <category>merge</category>
      <category>pull</category>
      <category>push</category>
    </item>
    <item>
      <title>Guide to semantic HTML5 tags!</title>
      <dc:creator>Jomagene</dc:creator>
      <pubDate>Sun, 14 Apr 2024 08:56:13 +0000</pubDate>
      <link>https://forem.com/kaliacad/guide-to-semantic-html5-tags-2n5b</link>
      <guid>https://forem.com/kaliacad/guide-to-semantic-html5-tags-2n5b</guid>
      <description>&lt;p&gt;Semantics, the study of meaning in the fields of linguistics and logic, plays a crucial role in web development. By using semantic HTML, we assign a clear identity to the content of our pages through various tags.&lt;/p&gt;

&lt;p&gt;From an HTML perspective, tags fall into two categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Semantic tags&lt;/strong&gt;, which clearly define the content they enclose. For example, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; denotes a paragraph, &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; indicates a main title.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-semantic tags&lt;/strong&gt;, such as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, which do not intrinsically convey information about their content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Div Trap
&lt;/h2&gt;

&lt;p&gt;Web developers often fall into the trap of overusing &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; tags, a phenomenon affecting both novices and seasoned developers alike. Despite the obvious advantages of semantic HTML, moving away from reliance on &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; can be challenging.&lt;/p&gt;

&lt;p&gt;Many websites use standard structures with common sections like headers, footers, and navigation bars. Caught in the div trap, developers often mark these areas as follows:&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&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"nav-bar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"home"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"service"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Service&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="nt"&gt;&amp;lt;/span&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unfortunately, this practice does not convey any semantic information to browsers since they do not understand this style of language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Should Adopt Semantic Tags
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improved Accessibility&lt;/strong&gt;: Using elements like &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; makes content more accessible and navigable, especially for users of assistive technologies, thus broadening your audience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better SEO&lt;/strong&gt;: Semantic tags act as indicators for search engines, improving your site's visibility and ranking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Maintenance and Collaboration&lt;/strong&gt;: Reducing the use of &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; simplifies code, facilitating collaboration and updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prepared for the Future&lt;/strong&gt;: The web is constantly evolving; using semantic HTML helps your projects stay relevant and functional.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're new to the field or an expert, the challenge is to fully embrace semantic HTML5, break old habits, and enjoy a better-structured, more accessible web. Breaking this cycle requires a conscious commitment to prioritize semantics and accessibility. This journey may take some out of their comfort zone, but the result—a more inclusive and sustainable web—is well worth the effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Choose the Right Semantic Tag
&lt;/h2&gt;

&lt;p&gt;Wondering about the proper use of semantic tags? We'll dive into the details to help you choose the right tag for each piece of content. In terms of the HTML specification, the elements we will be looking at fall into one of three groups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sectioning elements&lt;/strong&gt;, for broad strokes on an HTML page, like headers, footers, sections, and sidebar areas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grouping elements&lt;/strong&gt;, which are used to wrap associated elements. Think of paragraphs, blockquotes, and related content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text-level semantics&lt;/strong&gt;, which designate particulars, like &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tags.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's see some of the common used tags:&lt;/p&gt;

&lt;p&gt;a. &lt;strong&gt;The &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Meet the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; element in HTML5—it's perfect for highlighting the main part of your webpage. This tag helps clearly show what's unique about each page, ensuring it doesn't get mixed up with repeating elements, like navigation links or footers.&lt;/p&gt;

&lt;p&gt;Just remember two simple rules: only use one &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; per page to keep things clear, and don't place it inside other specific tags like &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;. Using &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; correctly makes your website easier to understand and use.&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="c"&gt;&amp;lt;!-- Header --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
    Our main content
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Footer --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;b. &lt;strong&gt;The &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; element organizes different parts of a webpage or application into clear segments. For example, you might use one &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; for contact information and another for news feeds. It's important to remember that &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; is not for styling purposes; if you just want to style a part of your page, you should use a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; to wrap visual components, helps clearly identify where each component starts and ends in the code.&lt;/p&gt;

&lt;p&gt;Decide if you should use a &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; by checking if the content has a natural heading (like &lt;code&gt;h1&lt;/code&gt; to &lt;code&gt;h6&lt;/code&gt;). If it doesn't, you're probably better off using a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;.&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;main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"contact-infos"&lt;/span&gt;&lt;span class="nt"&gt;&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;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"newsfeeds"&lt;/span&gt;&lt;span class="nt"&gt;&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;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. &lt;strong&gt;The &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; element in HTML5 is ideal for grouping major navigation links that direct users to different pages or sections of the same page. While it's typically not used for footers, it can be used there too. Instead of using an unordered list (&lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;) with list items (&lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;), try using &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; with nested &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tags (links) for a cleaner and more appropriate structure. This approach is especially suited for primary navigation areas.&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;nav&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#home"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#service"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Services&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    ...
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;d. &lt;strong&gt;The &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; element in HTML5 groups content that stands on its own. Ask yourself: If I moved this content to another website, would it still make complete sense? Or, would this content work as a separate article in an RSS feed? Good examples of when to use &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; include blog posts and news stories.&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;main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"contact-infos"&lt;/span&gt;&lt;span class="nt"&gt;&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;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"newsfeeds"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;My post&lt;span class="nt"&gt;&amp;lt;/article&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;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;e. &lt;strong&gt;The &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt; element in HTML is great for content that isn't the main focus but still relates to the main story, such as sidebars or tips in a blog post. It's also suitable for pull quotes, ads, and navigation links. For example, on an e-commerce site, the "Customers who bought this also bought" section would fit well in an &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;. Use it for anything that supports but isn't central to your main content.&lt;/p&gt;

&lt;p&gt;f. &lt;strong&gt;The &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; element is versatile. You can use it for the top part of a website, called the "masthead," or as an introduction at the start of different sections, like articles. Feel free to use multiple headers on the same page—one for each section if you like!&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;header&amp;gt;&lt;/span&gt;The masthead&lt;span class="nt"&gt;&amp;lt;/header&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;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"contact-infos"&lt;/span&gt;&lt;span class="nt"&gt;&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;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"newsfeeds"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;The newsfeed section head&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;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;g. &lt;strong&gt;The &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; element in HTML5 is similar to the &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;. It is used for displaying information related to the content around it, such as copyright information or links to other documents. You can use multiple footers on one page, such as one for the overall blog and another within an individual blog post.&lt;/p&gt;

&lt;p&gt;However, if you're adding contact information for the blog post's author, use the &lt;code&gt;&amp;lt;address&amp;gt;&lt;/code&gt; element instead of putting it in the footer. This helps keep your page organized and makes the type of information clear to users.&lt;/p&gt;

&lt;p&gt;In this example, the footer contains contact information and a copyright notice.&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;footer&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;address&amp;gt;&lt;/span&gt;
          For more details, contact
          &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:semjomagene@example.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Sem Joel Magene&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;.
     &lt;span class="nt"&gt;&amp;lt;/address&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&lt;/span&gt;© Copyright 2038 Example Corp.&lt;span class="nt"&gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Note on The HTML5 Outline Algorithm
&lt;/h3&gt;

&lt;p&gt;In simple HTML documents, you typically start with an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag for the main title and use lower-level heading tags (&lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;, etc.) for subtitles. However, HTML5 introduced a feature that allows each section of your document to have its own headings independently. This means you no longer have to worry about the heading levels for the entire document. Instead, you can focus on the headings within each specific section you are working on. For example, in a blog, both the post titles and the blog's main title can use &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tags independently, thanks to this feature.&lt;/p&gt;

&lt;p&gt;h. &lt;strong&gt;H1-H6 and &lt;code&gt;&amp;lt;hgroup&amp;gt;&lt;/code&gt; Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When creating web pages, it's best to use heading tags (h1 to h6) for main section titles only and not for their subheadings. For example, instead of:&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;h1&amp;gt;&lt;/span&gt;Scones:&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;The most resplendent of snacks&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consider using a different approach like this:&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;hgroup&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Scones:&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;The most resplendent of snacks&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/hgroup&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;hgroup&lt;/code&gt; holds the main heading and the subheading, but the subheading is in a paragraph tag (&lt;code&gt;p&lt;/code&gt;) instead of a heading tag (&lt;code&gt;h2&lt;/code&gt;). This helps keep your page structure clear and simple.&lt;/p&gt;

&lt;h4&gt;
  
  
  Grouping Elements
&lt;/h4&gt;

&lt;p&gt;We’ve now covered the lion’s share of the HTML sectioning elements. Let’s now consider grouping elements, like the one we’ve just seen. These elements are used to contain groups of other elements.&lt;/p&gt;

&lt;p&gt;i. &lt;strong&gt;The &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the most common way to group parts of a webpage. It's used a lot because it doesn't suggest any particular meaning—it simply groups content. However, it's best to use &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; only when no other element fits your needs. HTML has many other elements, and learning to use them can help you find better matches for your content.&lt;/p&gt;

&lt;p&gt;j. &lt;strong&gt;The &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This element is for marking paragraphs, but it's not just for short texts. Use it for any text that doesn't fit better in another element. It's a better choice than &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for general text because it specifically indicates that the content is a paragraph.&lt;/p&gt;

&lt;p&gt;k. &lt;strong&gt;The &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the world of HTML, the &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt; tag is your go-to when you need to highlight text quoted from another source. You don't necessarily need to encase the quoted text in another element, but you certainly can, like wrapping it with a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag for added structure. Here’s an example:&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 did like Ben's book, but he kept going on about scones. For example:&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;blockquote&amp;gt;&lt;/span&gt;
    All this writing about scones in our sample page and there's no image of the beauties! I'm going to add an image of a scone near the top of the page; a sort of 'hero' image to entice users to read the page.
&lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;l. &lt;strong&gt;The &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element in HTML is perfect for wrapping visuals like illustrations, photos, or code snippets, with the optional &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; to add a text description. While the &lt;code&gt;alt&lt;/code&gt; attribute is crucial for accessibility, providing a &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; is optional—use it if you want to explain or comment on the visual directly alongside it.&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;figure&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"MoneyShot"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"MoneyShotImg"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/scones.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Incredible scones baked to perfection and ready to eat"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"ImageCaption"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    This image isn't of scones I have made, instead, it's a stock photo from Wikipedia
  &lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;m. &lt;strong&gt;The &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern HTML gives us cool tools like the &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; elements to create expandable sections in web pages. Here’s a quick example:&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;details&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;I ate 15 scones in one day&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
        Of course I didn't. It would probably kill me if I did. What a way
        to go. Mmmmmm, scones!
    &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click the summary, and voilà! The text expands. Click again, and it collapses. Want it open from the start? Just add the &lt;code&gt;open&lt;/code&gt; attribute to the &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; tag. However, without some JavaScript, these elements won't automatically close others when one is opened. Despite this limitation, &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; are still great for adding simple toggle functionality to your site, far more neatly than the old &lt;code&gt;display: none;&lt;/code&gt; trick on a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  HTML Text-Level Semantic Elements
&lt;/h4&gt;

&lt;p&gt;Before HTML5, what we now refer to as text-level semantic elements were called inline elements. If you're familiar with that term, you're already on the right track! Let’s dive into the most common and useful text-level elements to get a better understanding of them.&lt;/p&gt;

&lt;p&gt;n. &lt;strong&gt;The &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element is like the simpler, text-focused cousin of the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;. It's the go-to choice when you need to style a section of text without adding any extra meaning or structure. It's straightforward and ideal for those little tweaks to your text.&lt;/p&gt;

&lt;p&gt;o. &lt;strong&gt;The &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditionally, the &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; element in HTML was used to make text bold. But its modern definition has shifted; now, the &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; tag is used to highlight text for practical reasons, such as drawing attention to keywords or product names, without implying any extra emphasis or change in tone.&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;b&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="nb"&gt;normal&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;This CSS tweak helps ensure that the text within &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; tags appears as intended without automatic bolding.&lt;/p&gt;

&lt;p&gt;p. &lt;strong&gt;The &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you need to highlight text because it's crucial, urgent, or serious, the &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; element is your go-to tool. Use it to make parts of a heading, caption, or paragraph stand out as especially important. It's perfect for spotlighting key details in a sea of text. Additionally, &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; works great for emphasizing warnings or urgent notices, ensuring that these critical messages catch the user's eye quickly. Keep this in mind to make essential information pop on your page.&lt;/p&gt;

&lt;p&gt;q. &lt;strong&gt;The &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Often misused just to make text italic, the &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag in HTML is actually meant to represent stress emphasis on its contents, not just to style text as italic.&lt;/p&gt;

&lt;p&gt;r. &lt;strong&gt;The &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In HTML5, the &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; element isn't just for making text italic. It's meant to give a different voice or mood to a span of text, setting it apart from the rest in a meaningful way. For instance, you might use it to highlight a scientific name in a paragraph or to indicate a special note like "No Salt Added" on a menu item in a web app.&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;However, discussion on the frameset element is now frustraneous as it's now gone the way of the &lt;span class="nt"&gt;&amp;lt;i&amp;gt;&lt;/span&gt;Raphus cucullatus&lt;span class="nt"&gt;&amp;lt;/i&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;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;French Fries &lt;span class="nt"&gt;&amp;lt;i&amp;gt;&lt;/span&gt;No Salt Added&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;

&lt;span class="nt"&gt;i&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;s. &lt;strong&gt;The &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For developers, the &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; element is indispensable when discussing code directly in HTML documents. It wraps code snippets, preserving the integrity of programming-related text and ensuring that it's easily recognizable as code.&lt;/p&gt;

</description>
      <category>html</category>
      <category>bestpractices</category>
      <category>semantic</category>
      <category>a11y</category>
    </item>
    <item>
      <title>Le phénomène d'effondrement de marge en CSS expliqué!</title>
      <dc:creator>Jomagene</dc:creator>
      <pubDate>Mon, 07 Aug 2023 10:19:35 +0000</pubDate>
      <link>https://forem.com/kadea-academy/-pourquoi-la-marge-de-mon-element-disparait--287m</link>
      <guid>https://forem.com/kadea-academy/-pourquoi-la-marge-de-mon-element-disparait--287m</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;La mise en page, la lisibilité et l'espacement sont quelques-uns des grands défis que pose le développement d'un site web.&lt;br&gt;
Au cours de la conception, on rencontre des défis qui, suite à un manque d'information, constituent un casse-tête et une source de grande frustration par la suite.&lt;/p&gt;

&lt;p&gt;Pourquoi ces écarts de marge entre certains blocs de ma page web? Et comment comprendre que des marges disparaissent? Et pourquoi cette marge-là semble-t-elle s’appliquer à mon conteneur et pas à mon titre ou mon paragraphe? Il se pourrait que vous êtes entrain de faire face au phénomène de fusion des marges. &lt;/p&gt;

&lt;p&gt;Cet article va répondre à toutes ces questions.&lt;br&gt;
Tout d'abord:...&lt;/p&gt;

&lt;h2&gt;
  
  
  Le phénomène de fusion de marge, comment le comprendre?
&lt;/h2&gt;

&lt;p&gt;L’effondrement ou la fusion des marges est un phénomène assez simple à comprendre. &lt;br&gt;
Il peut cependant être très déroutant lorsque vous travaillez à la structuration des mises en page. Lorsque deux marges verticales se rencontrent, elles s’effondrent l’une sur l’autre pour n’en former plus qu’une. La hauteur de cette marge fusionnée est égale à la hauteur de la plus grande des deux.&lt;/p&gt;

&lt;p&gt;L’effondrement ou fusion des marges se produit si on est dans un des cas suivants :&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;a. Des éléments voisins adjacents&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Lorsque deux éléments se trouvent l’un directement en dessous de l’autre, la marge inférieure du premier élément fusionne avec la marge supérieure du second sauf quand le dernier voisin doit passer à la ligne pour dégager les flottements. C’est le cas de l'illustration à la Figure 1.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qd9wseuy91vnwivz4c3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qd9wseuy91vnwivz4c3.png" alt="Image description" width="485" height="287"&gt;&lt;/a&gt;&lt;br&gt;
Figure 1 : Exemple d’élément dont la marge supérieure fusionne avec celle de l’élément précédent.&lt;/p&gt;

&lt;p&gt;A la figure 1, l'élément supérieur a une marge inférieure de 30 pixels et l'élément inférieur a une marge supérieure définie à 20 pixels. Le bon sens semblerait suggérer que la marge verticale entre ces deux éléments soit d’un total de 30px + 20px, soit de 50px. Mais en raison de l'effondrement de la marge, la marge réelle finit par être de 30 pixels.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;b. Aucun contenu séparant le parent et ses descendants&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Lorsqu’un élément est contenu dans un autre élément et qu’il n’existe pas de remplissage de bordure, de contenu en ligne (inline), de contexte de formatage de blocs ou dégagement, de height, min-height ou max-height pour séparer les marges hautes ou basses d’un ou plusieurs blocs descendants avec celles de leur parent, il s’en suit des fusionnements (voir Fig. 2).&lt;br&gt;
La marge fusionnée termine en dehors de l’élément parent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5yuo13seevtavu0litw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5yuo13seevtavu0litw.png" alt="Image description" width="510" height="208"&gt;&lt;/a&gt;&lt;br&gt;
Figure 2 : Exemple d’élément dont la marge supérieure se fusionne avec la marge supérieure de son élément parent.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;c. Des blocs vides&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Aussi étrange que cela puisse paraître, les marges peuvent s’effondrer sur elles-mêmes. Si un élément vide possède une marge mais sans bordure ni remplissage, la marge supérieure touche la marge du bas et les deux fusionnent (voir Fig. 3).&lt;br&gt;
Cela sous condition qu’il n'y ait aucune bordure, remplissage, contenu en ligne, height ou min-height pour séparer la marge haute d'un bloc de sa marge basse.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5m0pcgly558bqsyfi2je.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5m0pcgly558bqsyfi2je.png" alt="Image description" width="482" height="130"&gt;&lt;/a&gt;&lt;br&gt;
Figure 3 : Exemple d’élément dont la marge supérieure fusionne avec la marge inférieure.&lt;/p&gt;

&lt;p&gt;--&amp;gt; Si cette marge touche la marge d’un autre élément, elle s’effondre elle-même à nouveau (voir Fig. 4).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwrjw1ybd8odxgwxepvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwrjw1ybd8odxgwxepvy.png" alt="Image description" width="461" height="184"&gt;&lt;/a&gt;&lt;br&gt;
Figure 4 : Exemple de marge effondrée d’un élément vide qui fusionne avec les marges d’un autre élément vide.&lt;/p&gt;

&lt;p&gt;C’est pour cette raison que les séries d’éléments de paragraphe vides ne prennent que très peu d’espace, car toutes les marges s’effondrent et fusionnent pour n’en former plus qu’une.&lt;/p&gt;

&lt;p&gt;On peut avoir des cas de fusion plus complexes lorsque ces cas de figures sont combinés.&lt;br&gt;
Ces règles s'appliquent également lorsque les marges sont égales à 0. Ainsi, la marge d'un descendant finit toujours en dehors de l'élément parent (selon la deuxième règle vue ci-avant) quelle que soit la marge de l'élément parent (nulle ou non).&lt;br&gt;
Lorsqu'on manipule des marges négatives, la taille de la marge fusionnée est la somme de la marge positive la plus grande et de la marge négative la plus petite (celle dont la valeur est plus éloignée de 0).&lt;br&gt;
Les marges des éléments flottants et positionnés de façon absolue ne sont jamais fusionnées.&lt;br&gt;
Dans une disposition en grille (display : grid), les marges verticales adjacentes des éléments de la grille ne s’effondrent jamais. Ces marges sont contenues par les contours invisibles de la grille.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mais l’effondrement de marge est-ce une erreur de conception de CSS ?
&lt;/h2&gt;

&lt;p&gt;Après avoir vu ce qu'est le phénomène d'effondrement des marges en CSS, examinons si cela constitue en soi une erreur de conception de la part de CSS.&lt;/p&gt;

&lt;p&gt;L’effondrement des marges peut dérouter, mais il est en réalité parfaitement cohérent; et comprenez-le bien, ce n'est pas une erreur de la part de Css.&lt;/p&gt;

&lt;p&gt;Pour comprendre cela, considérez une page classique composée de plusieurs paragraphes (voir Figure 5). L’espace au-dessus du premier paragraphe est égal à la marge supérieure. Sans l’effondrement des marges, l’espace entre tous les paragraphes subséquents correspondrait à la somme de leurs marges adjacentes. Il serait alors le double de celui du haut de la page. Grâce à l’effondrement des marges, les marges du haut et du bas de chaque paragraphe fusionnent et produisent un espacement égal partout.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0myahtovk77yhj5amd8j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0myahtovk77yhj5amd8j.png" alt="Image description" width="513" height="297"&gt;&lt;/a&gt;&lt;br&gt;
Figure 5 : les marges s’effondrent afin que l’espace reste partout le même entre les éléments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
