html - aligning divs using float and z-index -



html - aligning divs using float and z-index -

i can't believe can't working!

this i'm going can't @ all!

+------------------------------------------+ | div 1 | | +-------------+ | | | div 2 | | +-------------| |--------------+ +-------------| |--------------+ | div 3 | | div 4 | | +-------------+ | | | +-----------------+ | |+-------------------------+ | || div 5 | | || | | || | +---------------++-------------------------+

i have tried placing divs in every different order possible.

i have container whole page set position: relative

#div1 { width: 950px; } #div2 { position: absolute; height: 150px; width: 150px; margin: -100px auto 0 auto; left: 0; right: 0; z-index: 88; } #div3 { float: left; width: 200px; z-index: 0; } #div4 { width: 400px; text-align: center; float: right; z-index: 0; } #div5 { width: 600px; float: right; clear: right; z-index: 0; }

i got divs 1,2,3 , 4 work fine. when add together div 5 messes up. div 2 seems issue, div 5 seems want align that.

if please help, save me bump on forehead!

you missing 2 things, in order absolutely position elements position:relative , must included within position relative wrapper. seems since element don't have defined hight collapse.

please see attached fiddle. http://jsfiddle.net/4tcj9/

html css

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -