【问题标题】:<br> Tag is not working in React js between elements<br> 标签在元素之间的 React js 中不起作用
【发布时间】:2022-01-21 13:13:20
【问题描述】:

在下面的代码中,&lt;br&gt; 标签不起作用。我在 vscode 工作,正在构建 reactjs 应用程序。

function Main()
{
    return(
    <>
        <div className="d-flex justify-content-center">
            <label for="height" className="text-info bg-secondary display-6" style={{marginRight: "40px",height:"50px"}}>
                Your Height:
            </label>
            <input type="text" id="height" placeholder="Centemeters"></input>

             <br /> /*This Tag is not working*/
             
            <label  className="text-info bg-secondary display-6" for="weight">
               Your Weight   /*this statement is showing side by side with above ones*/
            </label>
            <input type="text" id="weight" placeholder="KG"></input>
        </div>
    </>
    );
}

【问题讨论】:

    标签: reactjs forms tags line-breaks


    【解决方案1】:

    那是因为你有 display: flex;在包含元素的容器上。

    <div className="d-flex justify-content-center">
    

    【讨论】:

      猜你喜欢
      • 2022-01-06
      • 2018-05-01
      • 1970-01-01
      • 2023-03-08
      • 2021-07-14
      • 1970-01-01
      • 2018-05-03
      • 2016-10-29
      • 1970-01-01
      相关资源
      最近更新 更多