CSS 网格 justify-self 不在 Safari 中居中元素

发布于 2025-01-14 13:27:40 字数 396 浏览 5 评论 0原文

我有这个 div (移动菜单),通过 css gridjustify-self 属性在 chrome 中居中,但是在 safari 中,它位于屏幕左侧(instagram 图标后面):

在此处输入图像描述

是否有我可以使用的 webkit 属性,或者您有吗其他想法如何解决这个问题?

我正在使用 vue.js 来渲染 html。

I have this div (mobile menu) that is centered in chrome via css grid and justify-self property but in safari it sits on the left side of the screen (behind the instagram icon):

enter image description here

Is there a webkit property I can use or do you have any other idea how to fix this?

I am using vue.js to render the html.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假装爱人 2025-01-21 13:27:40

使用 align-self 属性应该可以。
相同的 W3Schools 参考

Using the align-self property should work.
W3Schools reference for the same

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文