简体   繁体   English

styled-components - 如何在表单中设置样式

[英]styled-components - how to set styles in form

When using styled-components in my React app, how do I set FormTitle styles like this?在我的 React 应用程序中使用styled-components时,如何设置FormTitle样式?

Expected Output:预期输出: 在此处输入图像描述

I want to do FormTitle and FormDescription are separate in the new line?我想在新行FormTitleFormDescription分开吗?

Code snippet : (DEMO)代码片段:(演示)

https://codesandbox.io/s/friendly-currying-533zce?file=/src/App.js https://codesandbox.io/s/friendly-currying-533zce?file=/src/App.js

What should I change in my code?我应该在我的代码中更改什么? Can anyone help me?谁能帮我? Thanks谢谢

You can use Phil's solution, or you can add flex-wrap: wrap;您可以使用 Phil 的解决方案,也可以添加flex-wrap: wrap; to ReccuringFormRow and width: 100%;到 ReccuringFormRow 和width: 100%; to ReccuringFormHeaderCell.到 ReccuringFormHeaderCell。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM