JS1
This commit is contained in:
@@ -6,12 +6,27 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>居中专题</title>
|
||||
<style>
|
||||
html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: rgb(255, 248, 238);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.stage {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: white;
|
||||
border: 1px solid rgba(255, 156, 7, 0.25);
|
||||
border-radius: 20px;
|
||||
@@ -34,7 +49,7 @@
|
||||
|
||||
<body>
|
||||
<div class="stage">
|
||||
<div class="box">把我放到中间</div>
|
||||
<div class="box">把我放到中间 transform: translate(-50%, -50%); </div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user