<style> *{margin:0; padding:0} html{height:100%;} body{height:100%;} .test{height:100%;border:1px solid red;} </style> <html> <body> <div class="test">xxx</div> </body> </html>