Skip to main content
Inspiring
June 3, 2020
Question

Whole page shifting left when I define a <p> width.

  • June 3, 2020
  • 1 reply
  • 1075 views

OK, I know I'm asking this question because I'm an absolute beginner when it comes to CSS but here goes.

Many of the pages on my website (older ones created with GoLive) Are just <p> <img> <p> <img> and on and on.

A page I am working on is all nice and centred and then I select a <p> and go "edit rule" and go to box and  change it from auto to 800px. I do this so the text doesn't go all the way across the page which makes it hard to read. When I hit apply it changes the box but the whole page goes from being centered to being left justified. Everything on the page is up against the left border. What on earth is going on?

    This topic has been closed for replies.

    1 reply

    Nancy OShea
    Community Expert
    Community Expert
    June 3, 2020

    Review the CSS Box model.

    https://www.w3schools.com/css/css_boxmodel.asp

     

    You didn't mention which property you changed so it's impossible to comment.  For better answers, show us your code.

     

    Nancy O'Shea— Product User & Community Expert
    gunzelguyAuthor
    Inspiring
    June 3, 2020

    The property I changed was <p> Box width, I changed it from auto to 800px wide.

     

    Here is a link to the page.

     

    https://www.victorianrailways.net/photogallery/suburb/sandingham_line/sandringham_line.html

    Nancy OShea
    Community Expert
    Community Expert
    June 3, 2020

    There is no such CSS property as box-width or box width. 

    Perhaps you mean CSS box-sizing

    In any case, the URL you posted contains neither.

     

    Nancy O'Shea— Product User & Community Expert