Html 该表没有';t与输入CSS正确对齐
这是我的问题,我试图用flexbox将我的输入和我的表格放在一个div中,但当我试图将它们一个接一个地放在另一个div中时,它们会改变度量值,并且没有正确对齐,我认为这是一个百分比问题,但我实际上不知道: 以下是我想要的: 但我得到的是: 在显示代码之前,我想清除一些内容: 类名w-100表示宽度:100%; 我把输入放在一个名为InputForm的组件中,我把输入的百分比放在其中 我的父容器:Html 该表没有';t与输入CSS正确对齐,html,css,reactjs,components,percentage,Html,Css,Reactjs,Components,Percentage,这是我的问题,我试图用flexbox将我的输入和我的表格放在一个div中,但当我试图将它们一个接一个地放在另一个div中时,它们会改变度量值,并且没有正确对齐,我认为这是一个百分比问题,但我实际上不知道: 以下是我想要的: 但我得到的是: 在显示代码之前,我想清除一些内容: 类名w-100表示宽度:100%; 我把输入放在一个名为InputForm的组件中,我把输入的百分比放在其中 我的父容器: const WithdrawalInfoContainer = ({ bitcoinPrice
const WithdrawalInfoContainer = ({ bitcoinPrice = '$0.000', myWalletPrice = '$0.000' }) => (
<div className='w-100'>
<div className='w-100 withdrawalInfoContainer'>
<h1 className='titleInfo'>Withdrawal Info</h1>
<div className='w-100 inputTableInfoContainer'>
<InputForm header='Withdrawal Method:' percentajeWidth='50%'/>
<div className='tableInfoContainer'>
<table>
<thead>
<tr>
<th id='withdrawalMethodInfo'>Withdrawal Method</th>
<th id='withdrawalAmountInfo'>Minimal Withdrawal Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bitcoin</td>
<td>{bitcoinPrice}</td>
</tr>
<tr>
<td>My Wallet</td>
<td>{myWalletPrice}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
);
输入表单组件:
const InputForm = ({ header, type = 'text', percentajeWidth, ...otherProps }) => (
<div className='containerInputForm'>
<label className='headerLabel' for={header}>{header}</label><br />
<input className='inputForm' name={header} type={type} style={{ width: `${percentajeWidth}`}} {...otherProps}/>
</div>
)
我不知道实际是什么,但我怀疑这是一个百分比问题,我试着把所有项目的w-100,但没有工作。非常感谢
const InputForm = ({ header, type = 'text', percentajeWidth, ...otherProps }) => (
<div className='containerInputForm'>
<label className='headerLabel' for={header}>{header}</label><br />
<input className='inputForm' name={header} type={type} style={{ width: `${percentajeWidth}`}} {...otherProps}/>
</div>
)
.containerInputForm {
margin-top: 10px;
}
.headerLabel {
font-size: 18px;
color: black;
letter-spacing: 2px;
}
.inputForm {
background-color: #E1DFDF;
border: none;
padding:10px;
}
.inputForm:focus {
background-color: #d1cfcf;
}