比如某聘网首页,网页整体居中显示,中间横屏轮播图宽2000多像素,但是浏览器却不会显示滑动条,我做了一下只要有个div宽度超出浏览器显示范围就会自动出现左右滑块,要怎么做才能使其不会出现左右滑块?
3条回答 默认 最新
关注 海报宽设置成百分百,内容页面宽设置一个固定值,就是默认显示的值,max-width设置成100%,也就是你怎么放大最多也只能到百分百
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <style> #box1 { background-color: aqua; width: 800px; max-width: 100%; height: 200%; margin: 0 auto; } #box2 { background-color: red; width: 100%; height: 50vh; } </style> <body> <div id="box2"> <div id="box1"> </div> </div> </body> <script> </script> </html>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 matlab代码代写,需写出详细代码,代价私
- ¥15 ROS系统搭建请教(跨境电商用途)
- ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。
- ¥20 CST怎么把天线放在座椅环境中并仿真
- ¥15 任务A:大数据平台搭建(容器环境)怎么做呢?
- ¥15 YOLOv8obb获取边框坐标时报错AttributeError: 'NoneType' object has no attribute 'xywhr'
- ¥15 r语言神经网络自变量重要性分析
- ¥15 基于双目测规则物体尺寸
- ¥15 wegame打不开英雄联盟
- ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)