回答編集履歴
1
追記
test
CHANGED
@@ -35,3 +35,121 @@
|
|
35
35
|
ModalPopup Demonstration
|
36
36
|
|
37
37
|
[https://ajaxcontroltoolkit.devexpress.com/ModalPopup/ModalPopup.aspx](https://ajaxcontroltoolkit.devexpress.com/ModalPopup/ModalPopup.aspx)
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
**【追記】**
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
下の 2018/08/27 14:46 の私のコメントで「<div class="page"> を真ん中に持ってくるので良ければ CSS でできると思います。回答欄にサンプルを追記しておきます」と書きましたが、それを以下に書きます。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
これがこのまま質問者さんのケースに適用できるかまでは調べてませんが、直接は適用できなくても、応用でやりたいことは実現可能かと思います。
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
```
|
54
|
+
|
55
|
+
<%@ Page Language="C#" AutoEventWireup="true"
|
56
|
+
|
57
|
+
CodeFile="0049-Centering.aspx.cs" Inherits="_0049_Centering" %>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<!DOCTYPE html>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
66
|
+
|
67
|
+
<head runat="server">
|
68
|
+
|
69
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
70
|
+
|
71
|
+
<title></title>
|
72
|
+
|
73
|
+
<style type="text/css">
|
74
|
+
|
75
|
+
body {
|
76
|
+
|
77
|
+
background: #555;
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
.content {
|
84
|
+
|
85
|
+
background: white;
|
86
|
+
|
87
|
+
width:500px;
|
88
|
+
|
89
|
+
height:300px;
|
90
|
+
|
91
|
+
position:absolute;
|
92
|
+
|
93
|
+
top:50%;
|
94
|
+
|
95
|
+
left:50%;
|
96
|
+
|
97
|
+
margin-left:-250px;
|
98
|
+
|
99
|
+
margin-top:-150px;
|
100
|
+
|
101
|
+
overflow:scroll;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
</style>
|
106
|
+
|
107
|
+
</head>
|
108
|
+
|
109
|
+
<body>
|
110
|
+
|
111
|
+
<form id="form1" runat="server">
|
112
|
+
|
113
|
+
<div class="content">
|
114
|
+
|
115
|
+
<h1>This page is horizontally / vaerically centered on
|
116
|
+
|
117
|
+
screens that are wider than 500 / 300 pixels.</h1>
|
118
|
+
|
119
|
+
<h2>Resize the browser window to see the effect.</h2>
|
120
|
+
|
121
|
+
<p>An absolutely positioned element is an element whose computed position value is absolute or fixed.
|
122
|
+
|
123
|
+
The top, right, bottom, and left properties specify offsets from the edges of the element's containing block.
|
124
|
+
|
125
|
+
(The containing block is the ancestor relative to which the element is positioned.)
|
126
|
+
|
127
|
+
If the element has margins, they are added to the offset.</p>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</form>
|
132
|
+
|
133
|
+
</body>
|
134
|
+
|
135
|
+
</html>
|
136
|
+
|
137
|
+
```
|
138
|
+
|
139
|
+
結果は以下の通り。ブラウザは Chrome 68.0.3440.106 です。
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+

|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
css の position の説明については以下の記事を見てください。
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
position
|
154
|
+
|
155
|
+
[https://developer.mozilla.org/en-US/docs/Web/CSS/position](https://developer.mozilla.org/en-US/docs/Web/CSS/position)
|