1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using div and span

Discussion in 'Microdata' started by Stephen L. Wilson, Jul 26, 2014.

  1. #1
    I am new to SEO coding. My HTML skills are fine, and microdata makes sense. The question I have is if it is proper to use double span commands instead of div and span? Like this:
    SEMrush
    <span itemscope itemtype=""><span itemprop=""> </span></span>

    Does this even work, or does the itemscope need to be in a hierarchy? Is there a 'best practice'? Thanks in advance for your help!
    ----------------

    I found my answer when I learned about nesting the data. I didn't see a way to strike through my original post. I also didn't see a way to delete it. That's why this post is goofy.
     
    Last edited: Jul 26, 2014
    Stephen L. Wilson, Jul 26, 2014 IP
    SEMrush
  2. RogueSkolar

    RogueSkolar Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    All else being equal, I don't think it matters what elements you add the microdata attributes to.
    You would of course want to use the most semantic tags/elements available. There's some debate
    over how the "new" semantic HTML5 tags impact SEO (whether at all), however, I don't think it
    would hurt to have as semantic and as clean code as possible.

    As far as I know, div and span don't have any semantic meaning and so you can really use any you
    like. The difference maybe is if you need the stuff be block-level then I'd probably use a div outer
    wrapper instead of span. If inline level is required then you can just go with span. You can nest span
    elements. That will validate fine. But this is mostly moot as you can just set display:block in your
    stylesheet anyway...

    *All else being equal == your markup is well structured and standards compliant (refer to W3C).

    **Edited to add:
    Make sure to run your markup through one of the numerous microdata structuring tools (Google's is decent)
    and the data being read is as expected.

    Good luck! [personally, hand coding microdata in the dev stage sucks for me ;-)]
     
    RogueSkolar, Jul 27, 2014 IP
  3. Stephen L. Wilson

    Stephen L. Wilson Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks for the information. The inline issue was what prompted the question, so thanks for addressing that as well.

    [personally, hand coding microdata in the dev stage sucks for me ;-)]

    Are there other alternatives? Reliable apps or programs?
     
    Stephen L. Wilson, Jul 27, 2014 IP
  4. mariatech

    mariatech Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4
    Thanks for sharing such a useful and important information about using span and div...
     
    mariatech, Sep 19, 2014 IP