html 按钮距离底部,html-将按钮固定到flexbox列布局的底部,margin-top:auto不起作用...

本文介绍了一个Flexbox新手在创建等宽等高的列布局时遇到的问题,并详细探讨了如何通过调整CSS样式使按钮与列底部对齐的方法。

我是flexbox的新手,只是尝试创建一组列,使其宽度/高度与内容最多的列保持相同,而且我似乎已经使该部分正常工作.我的问题是尝试固定按钮以使其与列的底部对齐.

我已经阅读了很多使用margin-bottom来实现此目的的示例,但是它对我不起作用.任何帮助表示赞赏…如您所见,我的技能充其量是最基本的. TIA

.columns {

display: flex;

flex-wrap: wrap;

justify-content: space-between;

}

.col {

display: flex;

flex-direction: column;

width: 24%;

border: 1px solid blue;

}

.list {

flex: 1;

padding: 10px;

}

.dir_button {

border: none;

outline: 0;

padding: 8px;

color: white;

background-color: #956a51;

text-align: center;

cursor: pointer;

width: 80%;

}

button.dir_button {

margin-top: auto

}

List item List itemList itemList item List item

EMAIL

List item List item
List item

List item

List item

List item
List item
List item
List item
List item List item
List item
List item
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>携程旅行 - 移动端</title> <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet"> <style> /* 基础样式重置 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { background-color: #f5f5f5; font-family: -apple-system, BlinkMacSystemFont, sans-serif; color: #333; } .container { max-width: 375px; margin: 0 auto; background-color: white; min-height: 100vh; } /* 搜索栏样式 */ .search-bar { padding: 12px; background-color: white; } .search-box { position: relative; } .search-input { width: 100%; padding: 10px 16px 10px 40px; border-radius: 20px; border: 1px solid #e5e5e5; font-size: 14px; outline: none; } .search-input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2); } .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #999; } /* 功能导航区样式 */ .function-area { padding: 8px; background-color: white; } .function-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; } .function-item { display: flex; flex-direction: column; align-items: center; padding: 4px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; } .function-item:active { opacity: 0.7; } .icon-wrapper { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; } .function-text { font-size: 12px; } /* 导航指示器 */ .nav-indicator { display: flex; justify-content: center; margin-top: 8px; } .indicator-dot { width: 6px; height: 6px; border-radius: 50%; margin: 0 2px; background-color: #ddd; } .indicator-dot.active { background-color: #1677ff; } /* 特价酒店区域 */ .special-area { padding: 12px; background-color: white; margin-top: 4px; } .special-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .special-title { font-size: 16px; font-weight: bold; color: #ff7d00; display: flex; align-items: center; } .special-tag { font-size: 12px; color: #ff7d00; background-color: #fff7e6; padding: 2px 6px; border-radius: 12px; } .hotel-card { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid #f5f5f5; margin-bottom: 12px; } .hotel-img { width: 100%; height: 144px; object-fit: cover; } .hotel-tag { position: absolute; top: 8px; left: 8px; background-color: #ff7d00; color: white; font-size: 12px; padding: 2px 8px; border-radius: 4px; } .hotel-info { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); padding: 8px; color: white; } .hotel-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hotel-price { font-size: 14px; font-weight: bold; margin-top: 4px; } /* 精选榜区域 */ .rank-header { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; } .rank-title { font-size: 16px; font-weight: bold; } .rank-tag { font-size: 12px; color: #999; } .rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .rank-card { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid #f5f5f5; } .rank-img { width: 100%; height: 96px; object-fit: cover; } .rank-city { position: absolute; top: 4px; left: 4px; background-color: rgba(0,0,0,0.6); color: white; font-size: 12px; padding: 1px 4px; border-radius: 2px; } .rank-info { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); padding: 6px; color: white; } .rank-name { font-size: 12px; font-weight: 500; } /* 广告横幅 */ .ad-banner { /* padding: 12px; background-color: white; margin-top: 4px; display: flex; */ width: 100%; max-width: 600px; /* 最大宽度限制 */ margin: 20px auto; /* 居中显示 */ padding: 0 15px; /* 左右留白,避免贴边 */ /* 使用Flexbox实现平均分布 */ display: flex; gap: 10px; /* 按钮之间的间距 */ flex: 1; } .banner-content { border-radius: 8px; padding: 12px; overflow: hidden; } .banner-wrapper { display: flex; align-items: center; } .banner-text { flex: 1; color: white; margin-bottom: 12px; } .banner-subtitle { font-size: 14px; } .banner-title { font-size: 18px; font-weight: bold; margin-top: 4px; } .banner-highlight { color: #ffdd54; } .banner-buttons { display: flex; gap: 8px; margin-top: 8px; } .banner-btn { padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 500; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; } .banner-btn:active { opacity: 0.8; } .btn-primary { background-color: white; color: #0066cc; } .btn-secondary { background-color: white; color: #0066cc; } /* 页脚信息 */ .footer { background-color: white; padding: 12px; text-align: center; margin-top: 4px; font-size: 12px; color: #999; } .footer-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; } .footer-link { color: #666; text-decoration: none; } .footer-separator { color: #ddd; } .footer-copyright { color: #999; } /* 底部导航栏 */ .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 375px; margin: 0 auto; background-color: white; border-top: 1px solid #e5e5e5; display: flex; justify-content: space-around; z-index: 100; } .nav-item { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; color: #999; text-decoration: none; -webkit-tap-highlight-color: transparent; } .nav-item.active { color: #1677ff; } .nav-icon { font-size: 20px; } .nav-text { font-size: 12px; margin-top: 2px; } /* 底部留白 */ .bottom-space { height: 56px; } </style> </head> <body> <div class="container"> <!-- 搜索栏 --> <header class="search-bar"> <div class="search-box"> <input type="text" placeholder="搜索:目的地/酒店/景点/航班号" class="search-input" > <i class="fa fa-search search-icon"></i> </div> </header> <!-- 功能导航区 --> <section class="function-area"> <div class="function-grid"> <!-- 第一行功能 --> <div class="function-item" style="background-color: #ff5a5f; color: white;"> <div class="icon-wrapper icon-hotel"> <i class="fa fa-building-o"></i> </div> <span class="function-text">酒店</span> </div> <div class="function-item" style="background-color: #007aff; color: white;"> <div class="icon-wrapper icon-flight"> <i class="fa fa-plane"></i> </div> <span class="function-text">机票</span> </div> <div class="function-item" style="background-color: #5856d6; color: white;"> <div class="icon-wrapper icon-train"> <i class="fa fa-train"></i> </div> <span class="function-text">火车票</span> </div> <div class="function-item" style="background-color: #4cd964; color: white;"> <div class="icon-wrapper icon-travel"> <i class="fa fa-pagelines"></i> </div> <span class="function-text">旅游</span> </div> <div class="function-item" style="background-color: #ff9500; color: white;"> <div class="icon-wrapper icon-strategy"> <i class="fa fa-map-o"></i> </div> <span class="function-text">攻略/景点</span> </div> <!-- 第二行功能 --> <div class="function-item" style="background-color: rgba(255, 107, 107, 0.1); color: #ff6b6b;"> <div class="icon-wrapper icon-homestay"> <i class="fa fa-home"></i> </div> <span class="function-text">民宿/客栈</span> </div> <div class="function-item" style="background-color: rgba(90, 200, 250, 0.1); color: #5ac8fa;"> <div class="icon-wrapper icon-flight-helper"> <i class="fa fa-plane"></i> </div> <span class="function-text">航班助手</span> </div> <div class="function-item" style="background-color: rgba(175, 82, 222, 0.1); color: #af52de;"> <div class="icon-wrapper icon-car-ship"> <i class="fa fa-bus"></i> </div> <span class="function-text">汽车/船票</span> </div> <div class="function-item" style="background-color: rgba(52, 199, 89, 0.1); color: #34c759;"> <div class="icon-wrapper icon-ticket"> <i class="fa fa-ticket"></i> </div> <span class="function-text">门票/活动</span> </div> <div class="function-item" style="background-color: rgba(255, 204, 0, 0.1); color: #ffcc00;"> <div class="icon-wrapper icon-shopping"> <i class="fa fa-shopping-bag"></i> </div> <span class="function-text">购物/免税</span> </div> <!-- 第三行功能 --> <div class="function-item" style="background-color: rgba(255, 149, 0, 0.1); color: #ff9500;"> <div class="icon-wrapper icon-food"> <i class="fa fa-cutlery"></i> </div> <span class="function-text">美食</span> </div> <div class="function-item" style="background-color: rgba(0, 122, 255, 0.1); color: #007aff;"> <div class="icon-wrapper icon-transfer"> <i class="fa fa-car"></i> </div> <span class="function-text">接送机/包车</span> </div> <div class="function-item" style="background-color: rgba(175, 82, 222, 0.1); color: #af52de;"> <div class="icon-wrapper icon-rent-car"> <i class="fa fa-car"></i> </div> <span class="function-text">租车</span> </div> <div class="function-item" style="background-color: rgba(52, 199, 89, 0.1); color: #34c759;"> <div class="icon-wrapper icon-nearby"> <i class="fa fa-tree"></i> </div> <span class="function-text">周边游</span> </div> <div class="function-item" style="background-color: rgba(255, 59, 48, 0.1); color: #ff3b30;"> <div class="icon-wrapper icon-loan"> <i class="fa fa-money"></i> </div> <span class="function-text">借钱/分期</span> </div> </div> <!-- 导航指示器 --> <div class="nav-indicator"> <div class="indicator-dot active"></div> <div class="indicator-dot"></div> <div class="indicator-dot"></div> </div> </section> <!-- 特价酒店和精选榜区域 --> <section class="special-area"> <div class="special-header"> <h2 class="special-title"> <i class="fa fa-fire mr-1"></i>特价·酒店 </h2> <span class="special-tag">特价好货直播中</span> </div> <div> <!-- 特价酒店 --> <div class="hotel-card"> <img src="https://images4.c-ctrip.com/target/0204p120009cen1cv995B_D_280_280_R5.jpg" alt="上海虹桥新华联索菲特大酒店" class="hotel-img"> <div class="hotel-tag">酒店套餐</div> <div class="hotel-info"> <p class="hotel-name">上海虹桥新华联索菲特大酒店 高级大床房 2晚套餐</p> <p class="hotel-price">¥928</p> </div> </div> </div> <!-- 携程精选榜 --> <div> <div class="rank-header"> <h2 class="rank-title">携程精选榜</h2> <span class="rank-tag">权威排行榜</span> </div> <div class="rank-grid"> <!-- 奢华酒店榜 --> <div class="rank-card"> <img src="https://dimg04.c-ctrip.com/images/200u11000000quu6h0E14_R_238_268.jpg" alt="奢华酒店榜" class="rank-img"> <div class="rank-city">上海</div> <div class="rank-info"> <p class="rank-name">奢华酒店榜</p> </div> </div> <!-- 亲子乐园酒店榜 --> <div class="rank-card"> <img src="https://dimg04.c-ctrip.com/images/1mc3t12000dh1t0n6E894_R_238_268.jpg" alt="亲子乐园酒店榜" class="rank-img"> <div class="rank-city">上海</div> <div class="rank-info"> <p class="rank-name">亲子乐园酒店榜</p> </div> </div> </div> </div> </section> <img src="img/携程旅行-酒店预订,机票预订查询,旅游度假,商旅管理-携程无线官网_files/0zg7312000jgweccc529C.jpg" alt="" class="rank-img"/> <!-- 广告横幅 --> <section class="ad-banner"> <div class="banner-content"> <div class="banner-wrapper"> <div class="banner-text"> <div class="banner-buttons"> <button class="banner-btn btn-primary"> <i class="fa fa-phone mr-1"></i>电话预订 </button> <button class="banner-btn btn-secondary"> <i class="fa fa-download mr-1"></i>下载携程 </button> </div> </div> </div> </div> </section> <!-- 页脚信息 --> <footer class="footer"> <div class="footer-links"> <a href="#" class="footer-link">网站地图</a> <span class="footer-separator">|</span> <a href="#" class="footer-link">电脑版</a> </div> <p class="footer-copyright">©2025携程旅行 沪ICP备08023580号</p> </footer> <!-- 底部导航栏 --> <nav class="bottom-nav"> <a href="#" class="nav-item active"> <i class="fa fa-home nav-icon"></i> <span class="nav-text">首页</span> </a> <a href="#" class="nav-item"> <i class="fa fa-globe nav-icon"></i> <span class="nav-text">社区</span> </a> <a href="#" class="nav-item"> <i class="fa fa-comment-o nav-icon"></i> <span class="nav-text">消息</span> </a> <a href="#" class="nav-item"> <i class="fa fa-user-o nav-icon"></i> <span class="nav-text">我的</span> </a> </nav> <!--底部导航留出空间 --> <div class="bottom-space"></div> </div> </body> </html>帮我检查一下是否是响应式布局,以及把两个按钮修改为平均分布在一行
最新发布
11-03
请帮我完善该vue项目在不同分辨率下的响应式设计,要求参考香格里拉酒店官网页面的设计风格:<template> <!-- 体验页面 --> <div class="experience"> <!-- 顶部导航栏 --> <NavBar /> <div class="container"> <!-- 首图内容区域 --> <div class="content-banner"></div> <div class="content-wrapper"> <!-- 商务接待 --> <div class="business margin-top-50"> <div class="img-box"> <responsive-image class="hd01" :small-image="hd01.smallImage1" :medium-image="hd01.mediumImage1" :large-image="hd01.largeImage1" alt-text="Description of image" /> <!-- <img src="../../assets/experience/hd-01.png" alt="" /> --> </div> <div class="text-box"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('Business') }}</p> <p class="content margin-top-20" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('text7') }} </p> <p class="more" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t("more14") }} </p> </div> </div> <!-- 度假之行 --> <div class="tourism margin-top-50"> <div class="text-box"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('trip') }}</p> <p class="content margin-top-20" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('text8') }} </p> <p class="more" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t("more15") }} </p> </div> <div class="img-box"> <responsive-image class="hd02" :small-image="hd02.smallImage2" :medium-image="hd02.mediumImage2" :large-image="hd02.largeImage2" alt-text="Description of image" /> <!-- <img src="../../assets/experience/hd-02.png" alt="" /> --> </div> </div> </div> <!-- 查看客房 --> <div class="content-swiper"> <div class="content-kefang"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Guest') }}</p> <!-- 轮播图 --> <div class="foot-swiper-box margin-top-50"> <RoomSwiper :bannerList="roomBannerList" /> </div> </div> <div class="content-kefang"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Apartment') }}</p> <!-- 轮播图 --> <div class="foot-swiper-box margin-top-50"> <RoomSwiper :bannerList="apartBannerList" /> </div> </div> <!-- 客房设施 --> <div class="device"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Facilities') }}</p> <div class="device-content margin-top-50"> <div class="img-box"> <img src="../../assets/experience/hd-01.png" alt="" /> </div> <div class="text-box"> <ul class="device-list"> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('WiFi') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('individually') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('TV') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('laundry') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('safes') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('coffee') }}</li> <li class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Minibar') }}</li> </ul> </div> </div> </div> </div> </div> <!-- 底部导航栏 --> <Footer /> </div> </template> <script> import RoomSwiper from "@/components/swiper/RoomSwiper.vue"; export default { name: "experience", components: { RoomSwiper, }, data() { return { msg: "Welcome to Your Vue.js App", // 响应式图片数据 hd01: { smallImage1: require("../../assets/experience/hd-01-mobile.jpg"), mediumImage1: require("../../assets/experience/hd-01.png"), largeImage1: require("../../assets/experience/hd-01.png"), }, hd02: { smallImage2: require("../../assets/experience/hd-02-mobile.jpg"), mediumImage2: require("../../assets/experience/hd-02.png"), largeImage2: require("../../assets/experience/hd-02.png"), }, roomBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], apartBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], }; }, }; </script> <style scoped> /* 全局响应式设置 */ .experience { width: 100%; overflow-x: hidden; } .container { width: 100%; max-width: 2560px; margin: 0 auto; } /* 顶部横幅区域 */ .content-banner { width: 100%; height: 50vh; /* 使用视口高度 */ min-height: 300px; /* 最小高度 */ max-height: 600px; /* 最大高度 */ background-image: url("../../assets/banner/banner-04.jpg"); background-size: cover; background-position: center; background-repeat: no-repeat; } /* 内容区域 */ .content-wrapper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } /* 商务/旅游模块 - 响应式网格布局 */ .business, .tourism { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin: 6rem 0; } /* 文本区域 */ .text-box { flex: 1 1 45%; /* 基础宽度45% */ min-width: 300px; /* 最小宽度 */ } .title-zh { font-size: clamp(2.4rem, 3.5vw, 3.6rem); /* 响应式字体 */ color: rgb(202, 171, 98); margin-bottom: 2rem; } .content { font-size: clamp(1.6rem, 2vw, 2rem); line-height: 1.8; margin: 2rem 0; font-family: "Fangsong"; } .more { display: inline-block; padding: 1rem 2.5rem; font-size: clamp(1.4rem, 1.8vw, 1.6rem); color: rgb(202, 171, 98); background-color: rgb(238, 235, 235); border-radius: 4px; cursor: pointer; transition: all 0.3s ease; } .more:hover { background-color: #e0dcdc; transform: translateY(-2px); } /* 新增底部导航适配 */ .footer { width: 100%; margin-top: auto; /* 确保底部固定 */ } /* 优化视口单位使用 */ :root { --vh: 1vh; } /* 强制图片覆盖容器 */ .responsive-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; /* 关键属性:保持比例填充 */ object-position: center; font-family: 'object-fit: cover'; /* 兼容旧版浏览器 */ } /* 图片容器基础样式强化 */ .img-box { height: auto; max-height: 400px; overflow: hidden; } .img-box img { width: 100%; height: auto; } .img-box:hover img { transform: scale(1.03); } /* 轮播图区域 */ .content-swiper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } .content-kefang { margin-bottom: 6rem; } .foot-swiper-box { margin-top: 3rem; } /* 设施区域 */ .device { margin-top: 2rem; } .device-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin-top: 4rem; } .device-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; font-size: clamp(1.6rem, 1.8vw, 1.8rem); line-height: 1.8; } .device-list li { position: relative; padding-left: 1rem; } /* 通用类 */ .text-center { text-align: center; } .textEn { font-family: "Times New Roman", Times, serif !important; } /* 新增4K屏幕适配样式 */ @media screen and (min-width: 2560px) { /* 主容器扩展 */ .content-wrapper, .content-swiper { width: 80%; max-width: 2200px; } /* 首图区域优化 */ .content-banner { height: 50vh; /* 全视口高度 */ min-height: 900px; } /* 商务/旅游模块优化 */ .business, .tourism { grid-template-columns: repeat(2, 1fr); gap: 6rem; align-items: stretch; /* 垂直拉伸 */ } /* 文本区域优化 */ .text-box { flex: 1 1 48%; /* 增加基础宽度 */ min-width: 400px; } /* 字体大小增强 */ .title-zh { font-size: clamp(3rem, 4.5vw, 5rem); } .content { font-size: clamp(1.8rem, 2.8vw, 3rem); } .more { font-size: clamp(1.6rem, 2.2vw, 2.4rem); padding: 1.5rem 3rem; } /* 设施列表优化 */ .device-list { grid-template-columns: repeat(3, 1fr); font-size: clamp(1.8rem, 2vw, 2.2rem); } } /* 新增4K+超宽屏适配 */ @media screen and (min-width: 3000px) { .content-wrapper, .content-swiper { width: 90%; max-width: 2800px; } .business, .tourism { gap: 8rem; } .content-banner { background-size: contain; /* 保持背景完整 */ } .device-list { grid-template-columns: repeat(4, 1fr); } } /* 优化现有媒体查询 */ @media screen and (max-width: 1024px) { .content-banner { height: 60vh; } .business, .tourism { gap: 3rem; } } @media screen and (max-width: 768px) { .content-banner { height: 50vh; background-image: url("../../assets/banner/banner-04-mobile.jpg"); } .business, .tourism { grid-template-columns: 1fr; } } </style>
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值