#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jul 2015
    Posts
    14
    Rep Power
    0

    Using ID and Class together harmful?


    Hi there

    Someone told me using an ID and a class together is "forbidden in SEO" (his words not mine). I find it hard to believe as both have their purpose.

    Is there any truth to that?

    Thanks!
  2. #2
  3. SEO Since 97
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    7,686
    Rep Power
    4753
    I have no idea what your talking about. ID and class together, huh?
    What is ID and what is class as far as seo goes?
  4. #3
  5. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jul 2015
    Posts
    14
    Rep Power
    0
    Sorry about that I meant in html. Like this:

    <div class="menus" id="top-menu"></div>

    He claims that one has to choose between the id and the class but you can't use both.
  6. #4
  7. Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Sep 2016
    Location
    United Kingdom
    Posts
    195
    Rep Power
    234
    If having sloppy html doesn't affect your ranking, I'm sure having ID and classes together wouldn't do anything.

    If it was a web designer which said this they're probably just trying to get more money out of you. Whenever I used to pay for any job just about all of them would claim html validation was essential to SEO, this that and the other - reality is they just wanted more work.

    To my knowledge as long as Google can render the page there's no issue, i doubt having an extra class / ID would make a 0.00001 of difference on load time either, so I don't think it's anything to do with speed

    Comments on this post

    • KnowOneSpecial agrees
  8. #5
  9. Just a Photographer
    SEO Chat Adventurer (500 - 999 posts)

    Join Date
    May 2011
    Location
    Atwater, CA
    Posts
    887
    Rep Power
    1896
    Having an ID and class in the same line is normal practice. Can't see this being an issue for SEO.

    Did he give you a source or is it one of those "I heard it from somebody that heard it from somebody..."

    Comments on this post

    • KnowOneSpecial agrees
    - Mike

    Jack of all trades, master of none.
  10. #6
  11. Dinosaur
    SEO Chat Genius (4000 - 4499 posts)

    Join Date
    Jun 2011
    Location
    UK
    Posts
    4,116
    Rep Power
    6553
    You example is normal practice for most websites. It does not effect SEO in the slightest.
    I had someone trying to instruct me the names of ID's and Class where an important SEO tactic so they would do the following

    <div id="Red-Shoes" class="red shoes">some text</div>

    I did mean to set up a test but in all honesty I could not be bothered to spend the time and effort to disprove the point.
    Owner of Page Explorer the page onsite SEO checker
    Useful Tools: Site Crawler: Screaming Frog | Free SSL: Cloudflare
  12. #7
  13. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jul 2015
    Posts
    14
    Rep Power
    0
    Originally Posted by matt1966
    If having sloppy html doesn't affect your ranking, I'm sure having ID and classes together wouldn't do anything.

    If it was a web designer which said this they're probably just trying to get more money out of you. Whenever I used to pay for any job just about all of them would claim html validation was essential to SEO, this that and the other - reality is they just wanted more work.

    To my knowledge as long as Google can render the page there's no issue, i doubt having an extra class / ID would make a 0.00001 of difference on load time either, so I don't think it's anything to do with speed
    He's actually someone who claims to be an SEO expert. He gets good results most of the time but sometimes he misunderstands some things and I need to countercheck unfortunately.

    Originally Posted by Hikin Mike
    Having an ID and class in the same line is normal practice. Can't see this being an issue for SEO.

    Did he give you a source or is it one of those "I heard it from somebody that heard it from somebody..."
    No he never does give his sources which is why I resort to this board to countercheck.

    Originally Posted by Chedders
    You example is normal practice for most websites. It does not effect SEO in the slightest.
    I had someone trying to instruct me the names of ID's and Class where an important SEO tactic so they would do the following

    <div id="Red-Shoes" class="red shoes">some text</div>

    I did mean to set up a test but in all honesty I could not be bothered to spend the time and effort to disprove the point.
    No don't lose your time with this. I kind of knew the answer too but I wanted to check with actual SEO experts first which I'm not. I'm a Web developer and this rule made absolutely no sens to me given the ID and the Class both have their unique purpose.

    Thank you all for your time!

Similar Threads

  1. 301 redirects are they harmful?
    By appsy in forum New User SEO Questions and Answers
    Replies: 0
    Last Post: Oct 3rd, 2014, 09:53 AM
  2. Can a sitemap be harmful?
    By theseoguy in forum Google Optimization
    Replies: 7
    Last Post: Jun 24th, 2009, 07:03 AM
  3. Bookmarking harmful for seo?
    By mx196 in forum Google Optimization
    Replies: 6
    Last Post: Oct 16th, 2008, 09:11 AM
  4. Affiliate Cloaking - Harmful for us?
    By snobba in forum Google Optimization
    Replies: 0
    Last Post: Oct 27th, 2007, 06:09 AM
  5. Class C and Class D IP address and Inbound Links limits.
    By hndlogic in forum Google Optimization
    Replies: 10
    Last Post: May 23rd, 2007, 03:49 AM

IMN logo majestic logo threadwatch logo seochat tools logo