简体   繁体   English

HTML / CSS边距或填充问题

[英]HTML/CSS margin or padding problem

I am redesigning a website to better work with mobile devices. 我正在重新设计网站,以更好地使用移动设备。 My problem is that on the right side of the page there is an open space, even though all the specified widths are the same. 我的问题是,即使所有指定的宽度都相同,页面的右侧还是有一个空白区域。 Here is the page: http://uniqueantiqueskingsport.com/wp7 . 这是页面: http : //uniqueantiqueskingsport.com/wp7 So far I have only tested it with the Windows Phone 7 emulator. 到目前为止,我仅使用Windows Phone 7模拟器对其进行了测试。

I don't have a WP7 to test this on, but I'm seeing the same when viewing on desktop browsers. 我没有WP7可以对此进行测试,但是在台式机浏览器上查看时却看到相同的结果。 The problem is your footer content, a lot of it is set at width: 320px , margin: x and padding: x . 问题是您的页脚内容,其中很多内容设置为width: 320pxmargin: xpadding: x Those margins are adding to the box model of your content, and forcing the page to expand. 这些边距增加了内容的盒子模型,并迫使页面扩展。

Read up on the box model at Sitepoint's awesome reference site . Sitepoint出色的参考站点上阅读盒子模型。

For the record, IE9 on Mango automatically zooms to fit the width of your content. 作为记录,芒果上的IE9会自动缩放以适合您内容的宽度。 But using a dynamic width would be much better. 但是使用动态宽度会更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM