×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What is "divitis" in HTML, and why is it considered a bad practice?

by EITCA Academy / Saturday, 15 June 2024 / Published in Web Development, EITC/WD/HCF HTML and CSS Fundamentals, HTML and CSS extending skills, Improving HTML and CSS code, Examination review

The term "divitis" refers to the overuse or misuse of `<div>` elements in HTML. This practice is considered detrimental to both the structure and the semantics of web documents. To fully grasp the implications of "divitis," one must comprehend the role of HTML in web development and how it relates to both the visual presentation and the underlying structure of web content.

HTML, or HyperText Markup Language, is the standard language used to create web pages. It provides the structure of a web page by denoting different elements such as headings, paragraphs, links, and images. The `<div>` element, short for "division," is a generic container used to group together other elements and apply styles or scripts to them collectively.

While `<div>` elements are versatile and essential for certain tasks, their overuse can lead to several issues. These issues stem from the fact that `<div>` elements do not convey any semantic meaning. They are purely structural and do not provide information about the type of content they contain. This lack of semantic value can negatively impact various aspects of a web page, including accessibility, search engine optimization (SEO), and code maintainability.

Impact on Accessibility

Accessibility is a important consideration in web development, as it ensures that web content is usable by people with disabilities. Screen readers and other assistive technologies rely on the semantic structure of HTML to convey the meaning and organization of content to users. When `<div>` elements are overused, especially in place of more appropriate semantic elements, it can hinder the ability of these technologies to interpret and present the content correctly.

For example, consider a web page that uses multiple `<div>` elements to create a navigation menu:

html
<div class="nav">
  <div class="nav-item">Home</div>
  <div class="nav-item">About</div>
  <div class="nav-item">Services</div>
  <div class="nav-item">Contact</div>
</div>

In this example, the use of `<div>` elements does not convey the purpose or structure of the navigation menu. A more semantically appropriate approach would be to use the `<nav>` element and `<ul>` (unordered list) along with `<li>` (list item) elements:

html
<nav>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact</a></li>
  </ul>
</nav>

This revised structure provides clear semantic meaning, indicating that the content is a navigation menu. Assistive technologies can then accurately convey this information to users, enhancing accessibility.

Impact on Search Engine Optimization (SEO)

SEO is the practice of optimizing web content to improve its visibility in search engine results. Search engines use algorithms to index and rank web pages based on various factors, including the semantic structure of the HTML. When `<div>` elements are overused, it can obscure the true meaning of the content, making it more difficult for search engines to accurately index and rank the page.

For instance, consider a blog post that uses `<div>` elements for headings and paragraphs:

html
<div class="blog-post">
  <div class="header">My Blog Post</div>
  <div class="content">
    <div class="paragraph">This is the first paragraph of the blog post.</div>
    <div class="paragraph">This is the second paragraph of the blog post.</div>
  </div>
</div>

This structure does not provide the necessary semantic information for search engines to understand the content. A more appropriate approach would be to use heading elements (`<h1>`, `<h2>`, etc.) and paragraph elements (`<p>`):

html
<article>
  <header>
    <h1>My Blog Post</h1>
  </header>
  <section>
    <p>This is the first paragraph of the blog post.</p>
    <p>This is the second paragraph of the blog post.</p>
  </section>
</article>

This revised structure clearly indicates the hierarchy and organization of the content, making it easier for search engines to index and rank the page appropriately.

Impact on Code Maintainability

Maintainability refers to the ease with which code can be understood, modified, and extended by developers. Overusing `<div>` elements can lead to a complex and unwieldy codebase, making it difficult to maintain and update the code.

Consider a web page layout that uses nested `<div>` elements for different sections:

html
<div class="container">
  <div class="header">
    <div class="logo">Logo</div>
    <div class="nav">Navigation</div>
  </div>
  <div class="main-content">
    <div class="sidebar">Sidebar</div>
    <div class="content">Content</div>
  </div>
  <div class="footer">Footer</div>
</div>

This structure can quickly become difficult to manage, especially as the complexity of the page increases. A more maintainable approach would be to use semantic elements such as `<header>`, `<nav>`, `<main>`, `<aside>`, and `<footer>`:

html
<div class="container">
  <header>
    <div class="logo">Logo</div>
    <nav>Navigation</nav>
  </header>
  <main>
    <aside>Sidebar</aside>
    <section>Content</section>
  </main>
  <footer>Footer</footer>
</div>

This revised structure is more readable and easier to maintain, as the purpose of each section is clearly indicated by the semantic elements.

Best Practices to Avoid "Divitis"

To avoid "divitis," web developers should strive to use semantic HTML elements whenever possible. Semantic elements provide meaning and context to the content, improving accessibility, SEO, and maintainability. Here are some best practices to follow:

1. Use Semantic Elements: HTML5 introduced several new semantic elements, such as `<header>`, `<nav>`, `<main>`, `<article>`, `<section>`, `<aside>`, and `<footer>`. These elements should be used to structure the content appropriately.

2. Use Appropriate Heading Levels: Headings (`<h1>`, `<h2>`, `<h3>`, etc.) should be used to indicate the hierarchy of the content. The main heading of a page should be an `<h1>`, with subsequent headings using lower levels as needed.

3. Use Lists for Grouped Content: When presenting grouped content, such as navigation menus or lists of items, use `<ul>` (unordered list) or `<ol>` (ordered list) elements along with `<li>` (list item) elements.

4. Use `<p>` for Paragraphs: Use the `<p>` element for paragraphs of text. Avoid using `<div>` elements for text content that is better suited to the `<p>` element.

5. Use `<figure>` and `<figcaption>` for Media: When including images, videos, or other media, use the `<figure>` element to group the media and the `<figcaption>` element to provide a caption.

6. Use `<table>` for Tabular Data: When presenting tabular data, use the `<table>` element along with `<thead>`, `<tbody>`, `<tr>`, `<th>`, and `<td>` elements to structure the table appropriately.

By following these best practices, developers can create more meaningful and well-structured HTML documents, avoiding the pitfalls of "divitis.""Divitis" is a common issue in web development that arises from the overuse or misuse of `<div>` elements. This practice can negatively impact accessibility, SEO, and code maintainability. By using semantic HTML elements and following best practices, developers can create more meaningful, accessible, and maintainable web content. Emphasizing the use of semantic elements not only enhances the user experience but also ensures that web content is accurately interpreted by search engines and assistive technologies.

Other recent questions and answers regarding EITC/WD/HCF HTML and CSS Fundamentals:

  • Should we ever use the div element or are the article and section element the main things we should use?
  • Why is having a sitemap particularly crucial for large websites or websites with poorly linked content?
  • What steps are involved in creating and registering an XML sitemap with search engines like Google?
  • What is the difference between an HTML sitemap and an XML sitemap, and how does each serve its intended audience?
  • How can including a sitemap on the front page of a website benefit both users and search engines?
  • What are the primary functions of a sitemap in the context of website usability and SEO?
  • What are the benefits and potential drawbacks of over-applying the DRY principle in web development?
  • How can the DRY (Don't Repeat Yourself) principle be applied to CSS to improve maintainability and reduce errors?
  • What are some potential negative impacts of using non-semantic elements like `<div>` tags on SEO and performance?
  • How does the overuse of `<div>` tags affect the separation of concerns in web development?

View more questions and answers in EITC/WD/HCF HTML and CSS Fundamentals

More questions and answers:

  • Field: Web Development
  • Programme: EITC/WD/HCF HTML and CSS Fundamentals (go to the certification programme)
  • Lesson: HTML and CSS extending skills (go to related lesson)
  • Topic: Improving HTML and CSS code (go to related topic)
  • Examination review
Tagged under: Accessibility, Code Maintainability, CSS, HTML, SEO, Web Development
Home » EITC/WD/HCF HTML and CSS Fundamentals / Examination review / HTML and CSS extending skills / Improving HTML and CSS code / Web Development » What is "divitis" in HTML, and why is it considered a bad practice?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

Eligibility for EITCA Academy 80% EITCI DSJC Subsidy support

80% of EITCA Academy fees subsidized in enrolment by

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2025  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    Chat with Support
    Chat with Support
    Questions, doubts, issues? We are here to help you!
    End chat
    Connecting...
    Do you have any questions?
    Do you have any questions?
    :
    :
    :
    Send
    Do you have any questions?
    :
    :
    Start Chat
    The chat session has ended. Thank you!
    Please rate the support you've received.
    Good Bad