CSS、HTMl实现div的高度填满剩余空间
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> *{ margin: 0; padding:0; } .content{ position: fixed; top: 50px; bottom: 0; width: 100%; } </style> </head> <body> <div class="top" style="background:red; height:50px; width:100%" ></div> <div class="content" style="background:yellow;"> </div> </body> </html>实现效果