Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CSS float and z-index

Discussion in 'Website Design Forum:' started by chrismitchell, Apr 23, 2010.

  1. Just thought I would ask, i'm sure that someone here will tell me. Does the H tag allow or float or z-index control? Or should I put an H tag within a DIV to control the z-index and float?

    I'm sure that Harry will come back and tell me not to lol
  2. Harry

    Harry Senior Member

    A div around it is unnecessary. Always avoid putting elements around other elements to manipulate them. It's akin to putting <div id="nav"> around your nav <ul>… pointless.
  3. So thats a yes to playing with the tags for float and z-index? :)
  4. Harry

    Harry Senior Member

    Yeah, put your floats on the H(1–6, no 7 or 8 ;) )
  5. Renniks

    Renniks Senior Member

    Should divs be avoided to group other divs
    for example having a left column always containing 5 divs, should you put a div around them so moving them as a block is easier? or is this using divs wrongly.
  6. Harry

    Harry Senior Member

    That's fine as you're not actually moving the five sidebar divs, you're moving the sidebar as a whole. With the heading, you're just moving the heading, so to put something around that to move it is silly and verbose.
  7. I really just want to have an H2 tag to sit ontop of a video :) i think i've done it, though it is no longer an H2 tag and is now a div instead, its not on the index page fortunately :) so hopefully won't play havoc with any SEO stuff :)
  8. tbwcf

    tbwcf Active Member

    Remember you your element needs position:relative; or position:absolute; for the z-index to apply, it's an easy one to catch you out as it doesn't work with the default position:static;
  9. :) thanks for that Andy :) I think its working great now :D not ready for all posts, but getting there :lol:
  10. Harry

    Harry Senior Member

    It's not a h2 tag, it's a h2 element ;)
    A tag is merely <h2> or </h2>. You're wanting to move <h2>This</h2> which is an element.

    Also, it's not about SEO, it's about best practices and semantics. Text should be contained in a text module element, not a generic block level container…
  11. I stand thoroughly corrected :) :lol:

    Well it seems to have worked well which is great :D Just still have some other things to clean up on widdlerswee then i'll be happy with it :) mainly my shop and the forum then it will be done :D
  12. Kevin

    Kevin Senior Member

    Hey chris, ask him if you should add an alt tag :rolleyes:

Share This Page