DEV Community

Vijay
Vijay

Posted on

<> Fixing HTML Elements </>

Generally we developers start with

and wrap everything into it .

If we need a button, form we just wrap it inside a div class .

Ever wondered if this is really correct ? or there is more to these HTML Elements which could be make code maintainability better .

SEO says " Use Semantic Elements if you want me 😁😁"


    1. element - a container where it could be used when there is no specific content and use it for purely styling.
      1. - a container when there is content marking , grouping of content & needs a common theme styling for that group. Use Section elements when we are mentioning Headings.
      1. - when the content matters the most , which could be used for blogs, articles, posts.

      • 1. Using div for button - Using div elements for buttons is not the efficient way to create a button component whereas the button element gives built in features and enables proper semantics .

      • 1. & - Wrapping the input inside label is more improvised usage than just connecting input to label using for.

      • 1. & - Both these make the text bold but gives importance to the text and web engine emphasizes readers to focus.

      Thus, using the right HTML elements -

      • Improves accessibility of content,
      • helps in SEO optimisation.

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay