• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Divitis: A Disease of the Markup

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Divitis is a condition that infects your HTML when it's overly exposed to the <div> element.
Left untreated, this infection can lead to:

  • ? Myopia – code that’s hard to read
  • ? Premature aging – messy and unscalable CSS
  • ? Partial numbness – inaccessible for assistive tech
  • ? Alzheimer's – SEO-unfriendly and hard to remember

Here’s what a Divitis case might look like:


<div class="header">
<div class="nav">
<div class="link">Home</div>
<div class="link">About</div>
</div>
</div>
The Cure: Semantic HTML


Around 2014, coinciding with the rise of HTML5, web scientists discovered an effective treatment: Semantic HTML.

Here's how the markup can be transformed after applying the cure:


<header>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>

Semantic elements help browsers and developers understand the meaning and structure of your content. They also make your site more accessible, maintainable, and SEO-friendly.

But Wait… Is <div> Really That Bad?


Let’s be clear — this is all a bit of metaphorical roleplay.
Just because I compared <div> to bacteria doesn’t mean it’s harmful by nature. In fact, <div> is still a valuable tool in HTML. There are cases where no semantic equivalent exists, and <div> is the best option.

Semantic HTML isn’t a silver bullet — it won’t eliminate every issue — but using it wisely helps prevent your codebase from turning into an unreadable, inaccessible mess.

TL;DR

  • ✅ Use semantic elements whenever possible
  • ✅ Avoid wrapping everything in <div>s
  • ✅ Remember: semantic HTML = better accessibility, structure, and SEO
  • ⚠ <div> is not evil, but overusing it is

Thanks for reading! If you’ve ever suffered from Divitis (or treated someone else’s), feel free to share your experience in the comments.
See you in the next post! ?


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу