What is the correct way to do a CSS Wrapper?

后端 未结 9 2141
后悔当初
后悔当初 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

    The easiest way is to have a "wrapper" div element with a width set, and a left and right margin of auto.

    Sample markup:

    
    
    
        
        
    
    
        
    your content...

提交回复
热议问题