1
How do I get this div to the center of the page?
.dialogbox {
position: absolute;
top: 30px;
width: 550px;
border-radius: 4px;
background: #FFFFFF;
margin: auto auto;
overflow: hidden;
display: none;
z-index: 9999;
}
I need to maintain the properties 'position: Absolute; top: 30px;' as it will appear on top of other div, and with a margin on top of 30px;
In the center with respect to width then?
– BrTkCa
Yes that’s right, horizontal
– Hugo Borges
Dude, I think it’s left: 50%
– Andrey Hartung
http://answall.com/questions/806/howto center horizontally on one side. see if this does not help you
– Andrey Hartung
not da, it gets crooked, I have to keep the size of the div of 'width: 550px;'
– Hugo Borges
margin: 0 auto? http://pt-br.learnlayout.com/margin-auto.html Obs: this is a lifehack
– Andrey Hartung
The problem is being due to the size being px, so the centering should be in function of the screen size. Can’t leave as with in %? Take a look at this: https://css-tricks.com/forums/topic/horizontal-centering-of-an-absolute-element/
– BrTkCa