我希望有人能告诉我如何让这个react模式移动响应。它没有使用bootstrap。
<ReactModal
isOpen={this.state.showModal}
style={{
overlay: {
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: 'rgba(0, 0, 0, 0.5)'
},
content: {
position: 'absolute',
top: 'auto',
marginLeft: '70px',
marginRight: '70px',
bottom: '200px',
border: '1px solid #ccc',
background: '#000',
overflow: 'auto',
WebkitOverflowScrolling: 'touch',
borderRadius: '10px',
outline: 'none',
padding: '20px'
}
}}>发布于 2019-05-08 01:16:55
您将不能添加媒体查询到您的模式的内联样式。
要添加媒体查询,应使用以下类:
React-modal Demo on GitHub: Using CSS classes for styling
然后,您将能够在CSS中为不同类型的屏幕添加不同的样式。
https://stackoverflow.com/questions/56027077
复制相似问题