叮当猫咪
尝试在该<head>部分中添加此内容<meta name="viewport" content="width=device-width, initial-scale=1.0">此外,您可能必须使用 CSS 媒体查询。如果你不熟悉它,最好先学习它。目前,请在您的 css 中使用以下媒体查询@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }@media (min-width:1281px) { /* hi-res laptops and desktops */ }示例用法/* Use a media query to add a breakpoint at 768px: */@media screen and (min-width: 768px and max-width: 1023px) { .main{ width: 80%; /* The main class's width is 80% , when the viewport is gretaer than 768px or smaller than 1023px which is ideal for tablets (not big tablets) */ }}