【发布时间】:2019-03-02 16:21:07
【问题描述】:
我正在尝试在图像周围环绕文字,如果我使用以下代码:
<div className="container">
<img src={myImageSource} alt="swimmer" height="300" width="300" style="float: left" />
<p> This is where the other text goes about the swimmer</p>
</div>
现在我知道这个style="float: left" 是html 5。但是如果我使用以下代码:
<div className="container">
<img src={myImageSource} alt="swimmer" height="300" width="300" align="left" />
<p> This is where the other text goes about the swimmer</p>
</div>
有效!为什么我不能在 React 中使用样式?
【问题讨论】: