div+css 代碼不能居中的一個問題


div+css 代碼不能居中的一個問題


沒理解你的意思 , 我現在的理解就是你只是要中間的#body部分居中而已 , 其他的不動就是了 , 那么你把#container{width:500px;}寬度去掉 , 改為#container{overflow:hidden;}#body{width:480px;overflow:hidden;margin:0px auto;}這樣應該是你要的效果了如果是要整體居中的話 , 其他都不用改 , 只有給#container加個margin:0px auto;就可以了
【div+css 代碼不能居中的一個問題】

    猜你喜歡