Replies

Nov 13, 2018 7 years ago
toonimal
is bright-eyed and bushy-tailed
User Avatar
Ay-ay

i have a border i'm using, and it's a centered background image. i'm trying to get my columns to stay lined up with it even at different screen sizes. however, using left: 50% seems to just stick the column in the upper left corner of the screen. right now i'm using vw units instead to keep it somewhat in place but i know there's a better way, i just can't think of it. is there something i'm missing here? ;_; this is my first time really trying to make myself a user profile asdkshdk

[sub]forum image by zu ❤️
[/sub]

Nov 13, 2018 7 years ago
Paula_459
is ALL about art
User Avatar
Qar

To position an element in the center of the screen you must use:

  left: 50%;
  margin-left: -(element width/2);

For example, if you have an element of 400px width, to position it in the center of the screen you must use: left: 50%; margin-left: -200px.

I hope this helps.

Please log in to reply to this topic.