Keeping an element in place when zooming out


This may seem really random but I’ve been trying to get a hold of you in regards to a post you made a while back about locating elements in html so that they dont shift when you zoom out ( My layout gets messed up when I zoom in and out - #11 by RyanReese )

I have a question that I really hope you can help me with(I’m very new to web development).

Youre answer in this thread definetely helped out alot for making sure that the elements dont when zooming out and keeping it centered. However, what if I the element I am positioning is not suppose to be centered but for example is to be to the left of the page. How might I keep it in place while making sure it doesnt move when I zoom out?

Thank you for taking the time to read this! Hope you can help.


Sebastian V


Anyone here can help you if you will post a link to your test site or a working page that demonstrates the issue.

Especially because you are new to HTML and CSS, it would be best if we can see your working code.


1 Like


I am not sure what you mean? are u saying that an element on the left stays left and sticks to the side when page zooms or are u saying that it’s on the left now and zooming out prevents it from moving left anymore?

If it is ment to stick to the left than that is suppose to be the normal flow of elements on the page unless styled otherwise. so maybe an example or the work you are working on may help than we can help you act on the effects of different styles.

but if u mean to keep it in place and not move anymore than you should consider wrapping that element inside another div/span and center that wrapper with margin: 0 auto; and apply a max-width to the wrapper that way when the wrapper reaches its full width the content inside is prevented from moving left anymore and will be like almost centered but not perfectly centered more like in the left place you wanted it?

so yeah as @ronpat mentioned maybe showing us something you working on or an example of what you have done so that we can help act on the styles there.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.