We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
绝对定位或者固定定位时,一定要设置两个方向的值(top,left)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> html, body { margin: 0; padding: 0; } .outer { position: fixed; top: 0; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; } .inner { width: 90%; height: 30%; top: 15%; left: 5%; // 如果不设置left, iOS10.3中会不居中(inner div的左侧在中央) position: absolute; background-color: red; } </style> </head> <body> <div class="outer"> <div class="inner"></div> </div> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
绝对定位或者固定定位时,一定要设置两个方向的值(top,left)
The text was updated successfully, but these errors were encountered: