Forums

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

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #186403
    Aritmos
    Participant

    http://codepen.io/anon/pen/uyanD

    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

    #186404
    Paulie_D
    Member

    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.

    https://css-tricks.com/centering-css-complete-guide/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.