Here is a simple way to achieve the center of pop-up window. Content is very good, now share to everyone, but also for everyone to make a reference.
Recently do the page often encounter the problem of the Center popup box,
Consulted a bit around the Daniel, finally out,
The principle of implementation:
1, define a pseudo-class for the outer box: Before
2, outer box define the fixed property
3, define the content box.
Define the outer box:
outbox{ position:fixed; top:0; rightright:0; bottombottom:0; left:0; Display:block; Text-align:center; }
Define the perimeter box pseudo-class:
outbox:before{ content= ""; width:0; height:100%; Display:inline-block; Vertical-align:middle; }
Define the Content box:
contentbox{ Display:inline-block; Vertical-align:middle; Text-align:center; }
All code:
<!doctype html>
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!