The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Center "p", "img" and "div" in a resizeable window
click “what” in the top right
as you can see i have some text a photo and more text. the problem is that if i try to center them i put: left: 50% and it goes way to the right when i shrink the window
same with text. Each element moves a different amount when resizing.
Any help is apreciated
Perhaps you could cut the codepen down to just the issue….a reduced case….if you will…like is mentioned in the Tips box —->
BTW…Left 50% doesn’t center…it puts the top left corner of the element at 50%…so you have to account for the width of the element to drag it back.