React Antd:如何在垂直分隔线和旁边的任何内容之间删除间距?

发布于 2025-01-27 01:28:39 字数 418 浏览 2 评论 0原文

</div>
<Divider type="vertical" style={{ width: "5px", height: "auto" , marginRight : '0px'  , padding : '0 0'}} />
<div style={{ padding : '0 0' , marginRight : '0px'}}>

这是我尝试过的,似乎无法删除分隔线和步进器(ANTD元素)之间的空间。

</div>
<Divider type="vertical" style={{ width: "5px", height: "auto" , marginRight : '0px'  , padding : '0 0'}} />
<div style={{ padding : '0 0' , marginRight : '0px'}}>

This is what I have tried and couldn't seem to remove the space between the divider and stepper(Antd element).

enter image description here

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

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

发布评论

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

评论(1

热鲨 2025-02-03 01:28:39

设置填充:

默认情况下为div#容器antd步骤的0px具有iD =容器的div = 24px

您看到的额外空间是由于该div-padding所致。

您可以通过在styles.css中定义以下代码并在组件中导入样式来将其删除。

styles.css

div#container {
  padding-left: 0px !important;
}

检查此 sandbox 更多的理解

Set padding:0px to div#container

Antd Steps by default has a div with id=container and padding=24px

enter image description here

The extra space you see is due to that div-padding.

You can remove it by defining the following code in styles.css and importing the styles in the component.

styles.css

div#container {
  padding-left: 0px !important;
}

Check this sandbox for more understanding

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