css - 如何在 React js 中将引导模型放置在屏幕的右下方?
问题描述
我正在使用内联 CSS 将模型放置在屏幕的右下方,但它无法正常工作
<div className="modal fade " style={{ width:'30%',position:'fixed',bottom:0,right:0,margin:0}} id="updateCategory" tabIndex="-1" aria-labelledby="exampleModalLabel2" aria-hidden="true" >
即使删除上面的所有 css 属性,除了width:'30%'
结果是相同的。
但是如果我使用以下样式,它会起作用
<div className="modal fade " style={{ width:'30%',bottom: 0,marginTop:260,marginLeft:900}} id="updateCategory" tabIndex="-1" aria-labelledby="exampleModalLabel2" aria-hidden="true" >
但我想使用底部 0 和右侧 0 。这些将如何工作。请帮忙
解决方案
试试看:
margin-left: auto;
margin-right: 0;
margin-top: auto;
margin-bottom: 0;
top: 100%;
transform: translateY(-100%);
推荐阅读
- javascript - 如何在顶部的自定义表格中添加一行?
- php - Laravel Vapor 使用获取参数从域根目录提供资产
- python - 没有名为“pygame.base”的模块
- makefile - 构建文件夹中的 `make -j `nproc` 给出:`make: *** 没有指定目标,也没有找到 makefile。停止。`macOS
- python - 比较不同的列以获得最高值,并将其余列返回为 NaN
- angular - 我可以为 favicon 使用角度材质图标吗?
- windows - 如何使用 windows 在 docker 中运行 Node-Red
- json - rml / r2rml 中是否有任何方法可以将值作为 IRI?
- javascript - 如何从 p5.js 中的特定点旋转矩形
- gdb - 在 gdb 中寻找特定功能