我怎样才能在正确的位置选择div?
问题描述:
我有几个< div> ,我想在特殊的地方选择它们
但问题是
位置:绝对;
顶部:350px;
left:300px;
是>>>>当我使用它并将它们放在正确的位置时,我放大了屏幕左侧的屏幕。
我怎么能放我的div正确的地方,当我缩小div选择中心
或当我放大div选择中心。
我想要div总是看到中心位置有特殊位置。
I have several < div > , i want to pick them
in special place but the problem with
position:absolute;
top:350px;
left:300px;
is >>>> when i used it and put them in correct place when i zoom in
the screen going to left side .
how can i to put my div to correct place and when i zoom out the div to pick center
or when i zoom in div to pick center .
I want to the div always see in center place with special position .
答
而不是你得到的东西放在下面(只需确保定义宽度)。并且不要在这里使用位置。
Instead of what you got there put the following (just make sure to define a width). And don't use position here.
margin-left: auto;
margin-right: auto;
http://stackoverflow.com/questions/18845131/absolute-div-top-position-changed-while-zoom-ctrl-in-chrome-浏览器 [ ^ ]
http://stackoverflow.com/questions/17492835/element-positions-upon-resizing-browser-or-zooming-in-out [ ^ ]