问题描述
iview Modal框垂直居中怎么做到
问题出现的环境背景及自己尝试过哪些方法
需要让Modal框做到水平垂直居中,水平是自动居中的,但是垂直居中没有达到。
position:absolute;
margin:auto;
left:0;
top:0;
right:0;
bottom:0;
这样做没有效果
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
iview Modal框垂直居中怎么做到
需要让Modal框做到水平垂直居中,水平是自动居中的,但是垂直居中没有达到。
position:absolute;
margin:auto;
left:0;
top:0;
right:0;
bottom:0;
这样做没有效果
// 请把代码文本粘贴到下方(请勿用图片代替代码)
<Modal
title="Title"
v-model="modal10"
class-name="vertical-center-modal">
<p>Content of dialog</p>
<p>Content of dialog</p>
<p>Content of dialog</p>
</Modal>
<style lang="less">
.vertical-center-modal{
display: flex;
align-items: center;
justify-content: center;
.ivu-modal{
top: 0;
}
}
</style>
官网已经有了垂直水平居中demo
https://www.iviewui.com/compo...
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
5 回答1.9k 阅读
官网已经有水平垂直居中的demo,直接用就好了
https://segmentfault.com/q/10...