CSS float and z-index

C

chrismitchell

Guest
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
 
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.
 
So thats a yes to playing with the tags for float and z-index? :)
 
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.
 
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.
 
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 :)
 
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;
 
:) thanks for that Andy :) I think its working great now :D not ready for all posts, but getting there :lol:
 
chrismitchell said:
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 :)

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…
 
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
 
Back
Top