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
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>设置height:100%无效</title> <style> * { margin: 0 auto; padding: 0; } html { height: 100%; } body { height: 100%; } </style> </head> <body> <div style="height: 100%; background-color: pink;">666</div> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当让一个元素的高度设置为百分比高度时,是相对于父元素的高度根据百分比来计算高度。
所以当父元素没有高度时,height:100%也就没有高度值。
The text was updated successfully, but these errors were encountered: