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

  • Home
  • SEARCH
  • 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 7882281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:14:50+00:00 2026-06-03T04:14:50+00:00

I would like to mark a tag with an id in HTML like this:

  • 0

I would like to mark a tag with an id in HTML like this:

<span id="id_errortag" 
    style="font-family:Helvetica;Font-size:14px;" class="red"></span>

I want to find out whether this is ok by HTML standards to use an id in conjunction with a class?

  • 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-06-03T04:14:51+00:00Added an answer on June 3, 2026 at 4:14 am

    It is perfectly acceptable to use both an id and a class on an HTML element, so long as you remember that id’s must be unique on the page. Classes can be used to group elements, but id must be unique.

    Aside from classes, you can use other attribute selectors to identify elements. You aren’t limited to just class and id. For instance, you could use a CSS selector to change the color of an input with a certain value.

    Keep in mind that one of the uses of class/id selectors is to help you keep your content, presentation, and behavior separate from each other, which will make it easier for Web designers to work with you. With CSS selectors, your JavaScript can be kept completely in external JavaScript files, your CSS can all be kept in an external CSS file, and your content can be kept inside the HTML.

    If someone needs to change the presentation or behavior, they can do so without needing to modify the HTML, and if someone needs to change the style, they don’t need to modify the HTML. This not only helps reduce bugs, but makes the code easier to maintain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to mark a method/class... obsolete but only after a specific date.
I'm rendering a form. I would like to put a mark next to all
Would like to be able to set colors of headings and such, different font
I would like to connect to a clustered Oracle database described by this TNS:
I would like to mark an arbitrary group of commits/changesets with a label. Commit
I would like to mark some pages in my site that is currently in
I have a question I would like to mark a point on a map
i would like to find/mark every 4th day in a continuous date stream inserted
what escape character is \u000a I would like it to be a quotation mark,
I would like to mark a folder as 'its content will be excluded from

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.