css - CSS Margin not working in React typescript project
问题描述
CSS margin not working in my react typescript project
My code:
const Home: React.FC = () => {
return (
<div style={{ width: "100vw", background: "skyblue" }}>
<div
style={{
background: "red",
height: "100px",
width: "100px",
marginLeft: "100px",
}}
></div>
</div>
);
};
解决方案
Your margin is overridden by margin: 0px !important
which is declared in your App.css
file
推荐阅读
- mongodb - 根据公式计算 AVG
- gatsby - 如何在 Gatsby 的构建时设置常量的值?
- postgresql - 同步 2 个数据库 1 未能提交
- java - 测量由 bukkit.event.Listener 处理的方法的运行时间
- python - 在无头模式下添加具有身份验证的代理
- json - 如何在 SwiftUI 中显示来自 json 文件的随机字符串?
- reactjs - React - 仅在异步操作完成时渲染组件(如 API 调用已解决)
- html - 如果我编辑 x 和 y 值,SVG 元素不会移动
- amazon-iam - 获取用户策略所需的 AWS IAM ListGroupsForUser
- python - 函数总和的curve_fit