What is the correct way to do a CSS Wrapper?

后端 未结 9 2136
后悔当初
后悔当初 2020-12-07 12:45

I have heard a lot of my friends talk about using wrappers in CSS to center the \"main\" part of a website.

Is this the best way to accomplish this? What is best pra

9条回答
  •  鱼传尺愫
    2020-12-07 13:32

    You don't need a wrapper, just use the body as the wrapper.

    CSS:

    body {
        margin:0 auto;
        width:200px;
    }
    

    HTML:

    
        

    some content

提交回复
热议问题