<html> <head> <title>標題</title> </head> <body> <style> #box{width:500px;height:100px;background:yellow;} @media screen and (min-width: 960px) and (max-width: 1199px) { #box { width:960px; height:500px; background:red; } } @media screen and (min-width: 500px) and (max-width: 960px) { #box { width:660px; background:green; height:500px; } } @media screen and (min-width: 300px) and (max-width: 500px) { #box { width:660px; background:coffee; height:500px; } } </style> <div id="box"> </div> </body> </html>