首页 > 编程知识 正文

css背景图片全屏铺满自适应,网页背景图片自适应屏幕

时间:2023-05-04 11:14:19 阅读:139688 作者:3052

css背景图会根据屏幕大小自动缩放

html,body{margin:0px; padding:0px; }

#background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow :隐藏; background-color: #211f1f; 显示: none (8; }

# background.BG-photo { position : absolute; top: 0; left: 0; width: 100%; height: 100%; 显示: none; overflow :隐藏; - WebKit-background-size : cover! 导入; - moz-background-size :防护罩! 导入; - o-background-size :防护罩! 导入; background-size :覆盖! 导入; }

# background.BG-photo-1 { URL (1. jpg ) no-repeat center center; }

# background-ie { position : fixed; top: 0; left: 0; width: 100%; height: 100%; overflow :隐藏; background-color: #211f1f; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。