# 移动设备上仍然需要取消自动边距吗？

**URL:** <https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503>\
**Category:** UX\
**Created:** [2025年二月10日 17:45 UTC](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503 "2025-02-10T17:45:41Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)\
**Post date:** [2025年二月11日 11:44 UTC](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503/6 "2025-02-11T11:44:33Z")

</div>

> [@pmusaraj](#):
>
> 我忍不住想说，在平板电脑的横屏模式下（甚至在竖屏模式下也是如此），默认使用移动用户代理是_错误_的选择。

我喜欢移动设备设置的一点是，侧边栏菜单会作为覆盖层滑入，而不是嵌入到页面中。对我来说，这在移动设备上感觉更“原生”。

为什么不直接添加一个断点声明呢？

```plaintext
@include breakpoint(mobile-extra-large) {
  #main-outlet-wrapper {
    margin-left: unset;
    margin-right: unset;
  }
}

```

这样，在狭窄的移动设备上会移除潜在的额外空间，而较宽的设备则会将包装器居中。

---

_[View the full topic](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503)._
