这是一种特殊的情况,但我不能做“父位置=相对,子位置=绝对”的把戏,因为
在我的函数组件中,我返回了如下内容:
<CustomPopupComponent>
<CustomNotificationComponent
style={marginBottom: '10vh'}
/>
</CustomPopupComponent>
我希望CustomNotificationComponent与CustomPopupComponent的底部边缘有一个固定的距离,但是我尝试使用marginBottom设置CustomNotificationComponent相对于整个浏览器窗口底部的距离。我可以在样式道具中添加任何值来使CustomNotificationComponent相对于CustomPopupComponent定位吗?我尝试使用marginbotton:'x%',但当我调整浏览器窗口的大小时,它也不一致。
设置“display:flex;flex-direction:column;align-items:flex-end;”在父级上,在子级上有适当的边距底部。祝你好运!