Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7085101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:23:00+00:00 2026-05-28T07:23:00+00:00

I have a general query regarding name of html elements. I have seen in

  • 0

I have a general query regarding name of html elements.

I have seen in the past developers placing an prefixes before the id of their html elements eg for a div element -> dvMyDiv

I have seen a mix of casing when naming elements. Similar to that of assigning name to element classes.

So I am wondering is there any standard or convention to what html elements should be named? What casing? Should they have prefixes etc?

I am working with asp.net web forms, html5, css3 and jquery so would like some form of standard for naming conventions that I can share with other developers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:23:00+00:00Added an answer on May 28, 2026 at 7:23 am

    I agree with consistency – if you already have a convention, then stick to it.

    However, if your making a new convention, this kind of Hungarian notation can be a really bad idea because it’s not at all DRY. For example, the name of the tag is <div> and then the name of your class again says that it’s a div. If you change from using <div>s to <section>s, either your code will be out of date or you’ll have to change all the class names as well (possibly in HTML, CSS and JavaScript). Since you can target classes using code like div.classname, it adds absolutely no value.

    A better idea is to name things after the type of content they include. For example, in a blog, you might use HTML like this:

    <section class="posts">
      <article id="post-1" class="post">
        <h1>Post Title</h1>
        <div class="post-content">
          <p>Blah blah blah</p>
          <p>Blah blah blah</p>
        </div>
        <time class="timestamp">17th January 2012</time>
      </article>
      <article id="post-2" class="post">
        <h1>Post Title</h1>
        <div class="post-content">
          <p>Blah blah blah</p>
          <p>Blah blah blah</p>
        </div>
        <time class="timestamp">18th January 2012</time>
      </article>
    </section>
    <aside class="top-posts block"></aside>
    <aside class="contact-form block"></aside>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the most general of cases, I have a query like below: SELECT tutor_school.name,
i have a general question about how sql server evaluates the joins.The query is
I have a general inquiry related to processing rows from a query. In general,
I have a general query that looks like this: SELECT DISTINCT pb.id, pb.last, pb.first,
I'm new to MySql and to databases in general. I have a query, which
I have some question regarding database performance in general. I'm using Sqlite but I
I have a general query about the jquery hide function. I have looked around,
I have a general exception handler, Application_error in my global.asax where I'm trying to
I have a general OOP question. If I have the following classes in C#
I have a general question that is rather open-ended (i.e. depends on platform, application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.