【发布时间】:2019-08-08 02:39:33
【问题描述】:
我正在构建我的第一个 React 模态。基本结构现在已经完成,但我希望在边框和内容之间有更多的填充。我认为这很简单,但我尝试了几件事,但都没有成功。
return (
<div className={classes.backDrop}>
<Modal
backdrop={'static'}
size='lg'
show={true}
centered={true}
style={classes.modalContainer}
data-testid='addFleetCustomerModal'
>
<div className='modalContainer'>
<ModalHeader>
</ModalHeader>
<Modal.Body>
<Modal.Title>
Add Customer
</Modal.Title>
<Form.Group>
<Form.Label className={classes.highlight}>Company Name*</Form.Label>
<Form.Control id='companyName' data-testid='companyName' type='text' placeholder='For example: ABC Corp.'
/>
</Form.Group>
<Form.Group>
<Form.Label>
<strong>NOTES</strong><br/>
Notes added here can only be viewed and edited by other team members.
</Form.Label>
<textarea className="form-control" id="companyNotes" rows="3"></textarea>
</Form.Group>
</Modal.Body>
<Modal.Footer>
<Row>
<a href='/#'>Cancel</a>
<Button variant='secondary' size='sm'> Next </Button>
</Row>
</Modal.Footer>
</div>
</Modal>
</div>
);
关于我应该添加什么 CSS(以及在哪里)将模态内容向内移动一点有什么想法吗?
【问题讨论】:
-
你能告诉我们你的尝试吗?
-
内容是指
<Modal.Body>或整个<Modal>中的内容?
标签: css reactjs react-bootstrap