From f9319e244bea02bafabb666b3f93ae1bf7aec565 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 15 Nov 2016 15:02:30 +0800 Subject: [PATCH] Add compatible css centered demo code, close #3849 --- components/modal/demo/manual.md | 3 ++- components/modal/demo/position.md | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/modal/demo/manual.md b/components/modal/demo/manual.md index 3d680d3b7c..3f09e47861 100644 --- a/components/modal/demo/manual.md +++ b/components/modal/demo/manual.md @@ -1,6 +1,7 @@ --- order: 7 -title: +debug: true +title: zh-CN: 手动移除 en-US: Manual to destroy --- diff --git a/components/modal/demo/position.md b/components/modal/demo/position.md index fb15f62494..d27ab08539 100644 --- a/components/modal/demo/position.md +++ b/components/modal/demo/position.md @@ -1,6 +1,6 @@ --- order: 7 -title: +title: zh-CN: 自定义位置 en-US: To customize the position of modal --- @@ -68,6 +68,28 @@ ReactDOM.render(, mountNode); ````css /* use css to set position of modal */ +.vertical-center-modal { + text-align: center; + white-space: nowrap; +} + +.vertical-center-modal:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; + width: 0; +} + +.vertical-center-modal .ant-modal { + display: inline-block; + vertical-align: middle; + top: 0; + text-align: left; +} + +/* +// Use flex which not working in IE .vertical-center-modal { display: flex; align-items: center; @@ -77,4 +99,5 @@ ReactDOM.render(, mountNode); .vertical-center-modal .ant-modal { top: 0; } +*/ ````