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 6604023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:05:45+00:00 2026-05-25T19:05:45+00:00

Possible Duplicate: Use HTML tag names, classes or IDs in CSS? In CSS, what

  • 0

Possible Duplicate:
Use HTML tag names, classes or IDs in CSS?

In CSS, what are the major differences with classes and ids? Why use classes for xyz and why use ids for abc? I know there are similar questions on here, but none are really answered properly.

I know to use classes with multiple elements with the same properties and ids with unique properties or unique elements, but why? Wouldn’t it be an acceptable practice to just use classes so that you don’t confuse yourself switching between classes and ids? What is the difference in regards to speed and optimization, SEO, etc…?

  • 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-25T19:05:45+00:00Added an answer on May 25, 2026 at 7:05 pm

    Wouldn’t it be an acceptable practice to just use classes so that you don’t confuse yourself switching between classes and ids?

    Yes it would be, but let’s say you have 1 class for 20 boxes that has like 20 css properties set and you want 1 div to have a different border color it would be better to just give an id to that div instead of creating a whole new class. (if you get what I mean)

    Just add the

    #specialdiv{
      border-color: #000;
    }
    

    instead of creating a whole new class with the same 19 properties and 1 that is different. Ofcourse you aren’t force to use a id for this, you can also assign another extra class to this div. (Such as <div class="box special">)

    What is the difference in regards to speed and optimization, seo, etc…?
    This has a simply answer, if you optimize your css, it will result in a lower file size thus resulting in a faster load time which will improve your rankings. (Yes website speed/loading time does matter A LOT)

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

Sidebar

Related Questions

Possible Duplicate: Why not use tables for layout in HTML? i know that using
Possible Duplicate: Why not use tables for layout in HTML? I know everyone is
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: How can I use a carriage return in a HTML tooltip? I'd
Possible Duplicate: When to Use Static Classes in C# Questions in the title..........i would
Possible Duplicate: Why not use tables for layout in HTML? These days, I am
Possible Duplicate: Convert HTML to PDF in .NET How can i use the acrobat
Possible Duplicate: What's the point of valid CSS/HTML? This is a over-asked question, but
Possible Duplicate: How to use ternary operator in razor (specifically on HTML attributes)? I
Possible Duplicate: Html validation error for property attribute According to facebook to use their

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.