javascript - 如何在 react js中换行后使文本对齐

标签 javascript css reactjs styles

我无法让文本在换行后对齐。我试过使用 css(文本的底部边距等)。

边距底部不起作用。也尝试更改行高但无济于事。

<Col md={6}>
  <ul className="deets">
    <li><FaRegHandshake classname="icons"/><span style={{marginBottom:"90", marginLeft:"5px"}}>Let us help you  {this.state.personalized}</span></li>
    <li><FaPhone classname="icons"/><span style={{marginBottom:"90", marginLeft:"5px"}}>Our representative contacts you within 24 hours</span></li>
    <li><FaToolbox classname="icons"/><span style={{marginBottom:"90", marginLeft:"5px"}}>We collect all the necessary requirements from you</span></li>
    <li><FaUserSecret classname="icons"/><span style={{marginBottom:"90", marginLeft:"5px"}}>We keep confidentiality with all of our clients by signing NDA</span></li>
  </ul>
</Col>

This is an image of my current problem

问题是对于每个 <li>元素,当文本换行时,第二行的文本与其上方的图像水平对齐,并且不缩进以与其上方的文本水平对齐,这是相同的 <li> 的一部分。 .

最佳答案

尝试:

li {
  display: flex;
  flex-direction: row;
}

你或许可以删除内联样式

关于javascript - 如何在 react js中换行后使文本对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54045809/

相关文章:

reactjs - redux-form:path.lastIndexOf 不是由于 "Object object"作为表单名称而卸载组件时引发的函数错误

javascript - 将 react 组件(或元素?)放入对象中。

javascript - 在 C# ASP.Net 应用程序中使用 JavaScript 淡入淡出(闪烁)文本

javascript - Bootstrap 网格类用法

javascript - React 组件未接收 props

jquery - 对排除第一条记录的 jquery 数据表列进行排序

html - 隐藏文件输入元素在 IE Edge 上不起作用

javascript - 服务端渲染如何使用跨域cookie?

javascript - AngularJS - 对 Web Api 端点的 $HTTP 错误请求

javascript - 如何解决未捕获的类型错误 : Cannot read property 'length' of undefined of my Global varible?