移动端rem设置,自动更改html<font-size>

本文介绍了一段JavaScript代码,通过监听窗口大小变化,动态调整网页元素的字体大小,确保不同设备上的内容呈现清晰易读。对于iPhone 4和iPhone 6等不同尺寸的屏幕,字体大小会相应调整为合适的值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<script>        
        (function (doc, win) {    
            var docEl = doc.documentElement,    
            resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',    
            recalc = function () {    
            var clientWidth = docEl.clientWidth;    
            if (!clientWidth) return;    
            docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';    
        };    
        if (!doc.addEventListener) return;    
        win.addEventListener(resizeEvt, recalc, false);    
        doc.addEventListener('DOMContentLoaded', recalc, false);    
        })(document, window);    
 </script>

加入这么一段js,就可以根据屏幕的宽度动态改变font-size

根据这一句 docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';  可知

iphone4宽度是320px,那么font-size就是20px, 100px就是5rem

iphone6宽度是375px,那么font-size就是23.4375px,100px就是4.267rem

转载于:https://www.cnblogs.com/zhouzhou163/p/5389665.html

<script lang="ts"> import { ref, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { useRouter } from 'vue-router' import request from '@/utils/request' import type { ResultModel } from '@/api/stu' // 定义登录请求数据类型 interface LoginData { username: string password: string } //修改密码 export const updatePasswordApi = (data: LoginData) => request.put<any, ResultModel>('/emps/update', data) //修改员工信息 let router = useRouter() const loginName = ref('') //定义钩子函数, 获取登录用户名 onMounted(() => { //获取登录用户名 const token = localStorage.getItem('token') || '{}' let loginUser = JSON.parse(token) console.log(loginUser) if (loginUser) { loginName.value = loginUser.name } }) const logout = () => { //弹出确认框, 如果确认, 则退出登录, 跳转到登录页面 ElMessageBox.confirm('确认退出登录吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }).then(() => { //确认, 则清空登录信息 ElMessage.success('退出登录成功') localStorage.removeItem('loginUser') router.push('/login') //跳转到登录页面 }) } </script> <template> <div class="common-layout"> <el-container class="layout-container"> <!-- 头部 --> <el-header class="header"> <span class="title">AI教学管理系统</span> <div class="tools"> <a href=""> <el-icon><EditPen /></el-icon> 修改密码 </a> <a href="javascript:void(0)" @click="logout"> <el-icon><SwitchButton /></el-icon> 退出登录 【{{ loginName }}】 </a> </div> </el-header> <el-container class="main-container"> <!-- 侧边栏 --> <el-aside class="aside"> <!-- 使用 el-scrollbar 包裹菜单 --> <el-scrollbar class="menu-scrollbar"> <el-menu router default-active="1" class="side-menu" background-color="#2c3e50" text-color="#ecf0f1" active-text-color="#f39c12" > <!-- 首页 --> <el-menu-item index="/index"> <el-icon><Menu /></el-icon> <span>首页</span> </el-menu-item> <!-- 班级学员管理子菜单 --> <el-sub-menu index="2" class="menu-group"> <template #title> <el-icon><Document /></el-icon> <span>班级学员管理</span> </template> <el-menu-item index="/stu" ><el-icon><UserFilled /></el-icon>学员管理</el-menu-item > <el-menu-item index="/clazz" ><el-icon><HomeFilled /></el-icon>班级管理</el-menu-item > </el-sub-menu> <!-- 部门员工管理子菜单 --> <el-sub-menu index="3" class="menu-group"> <template #title> <el-icon><Avatar /></el-icon> <span>部门管理</span> </template> <el-menu-item index="/emp" ><el-icon><Avatar /></el-icon>员工管理</el-menu-item > <el-menu-item index="/dept" ><el-icon><HelpFilled /></el-icon>部门管理</el-menu-item > </el-sub-menu> <!-- 新增的统计管理子菜单 --> <el-sub-menu index="4" class="menu-group"> <template #title> <el-icon><PieChart /></el-icon> <span>数据统计管理</span> </template> <el-menu-item index="/report/emp" ><el-icon><InfoFilled /></el-icon>员工信息统计</el-menu-item > <el-menu-item index="/report/stu" ><el-icon><Share /></el-icon>学员信息统计</el-menu-item > <el-menu-item index="/log" ><el-icon><clock /></el-icon>日志信息统计</el-menu-item > </el-sub-menu> </el-menu> </el-scrollbar> </el-aside> <!-- 主内容区 --> <el-main class="main-content"> <router-view></router-view> </el-main> </el-container> </el-container> </div> </template> <style scoped> /* 布局基础样式 */ .common-layout { height: 100vh; display: flex; flex-direction: column; } .layout-container { height: 100%; display: flex; flex-direction: column; } /* 头部样式 */ .header { background-color: #2c3e50; color: white; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); z-index: 10; } .title { font-size: 1.5rem; font-weight: bold; } .tools a { color: #ecf0f1; text-decoration: none; margin-left: 20px; display: inline-flex; align-items: center; transition: background-color 0.3s ease; border-radius: 4px; padding: 6px 10px; } .tools a:hover { background-color: #34495e; } /* 侧边栏样式 */ .aside { background-color: #2c3e50; color: #ecf0f1; height: 100%; padding-bottom: 20px; } /* 自定义滚动条样式 */ .menu-scrollbar { height: calc(100vh - 60px); /* 减去 header 高度 */ } .menu-scrollbar .el-scrollbar__bar.is-vertical { width: 6px; right: 2px; border-radius: 4px; background-color: rgba(255, 255, 255, 0.1); } .menu-scrollbar .el-scrollbar__thumb { background-color: rgba(255, 255, 255, 0.3); border-radius: 4px; transition: background-color 0.3s ease; } .menu-scrollbar .el-scrollbar__thumb:hover { background-color: rgba(255, 255, 255, 0.5); } /* 菜单样式 */ .side-menu { background-color: transparent; border-right: none; padding: 10px 0; } /* 菜单项通用样式 */ .side-menu .el-menu-item, .side-menu .el-sub-menu .el-sub-menu__title { margin: 6px 0; padding: 10px 20px; font-size: 14px; color: #ecf0f1; border-radius: 6px; transition: all 0.3s ease; } /* 悬停样式 */ .side-menu .el-menu-item:hover, .side-menu .el-sub-menu .el-sub-menu__title:hover { background-color: #34495e; } /* 激活项样式 */ .side-menu .el-menu-item.is-active { background-color: #34495e; color: #f39c12 !important; font-weight: bold; } /* 子菜单项样式 */ .menu-group .el-menu-item { font-size: 13px; padding-left: 40px !important; color: #dcdcdc; transition: all 0.3s ease; } .menu-group .el-menu-item:hover { background-color: #3a5267; } .menu-group .el-menu-item.is-active { background-color: #3a5267; color: #f1c40f; } /* 主内容区样式 */ .main-content { background-color: #f9f9f9; padding: 20px; flex: 1; overflow-y: auto; } /* 响应式设计 */ @media (max-width: 768px) { .tools a { margin-left: 10px; font-size: 0.9rem; padding: 4px 8px; } .title { font-size: 1.2rem; } .menu-group .el-menu-item { font-size: 12px; padding-left: 25px !important; } } </style> 优化一下代码逻辑,以及头部效果 ,有个修改密码的api完善一下修改密码功能
最新发布
07-24
在该vue项目下怎样将底部导航栏<footer>组件固定在底部,在不同设备打开时也不会位移,请提供修改后的完善代码:<template> <!-- 唯一根元素开始 --> <div class="container"> <!-- 顶部导航栏 --> <NavBar /> <!-- 中心大图展示区域 --> <section class="hero-section"> <img src="@/assets/recreation/fitness.png" alt="健身房内部场景" class="hero-image" > </section> <!-- 文字说明区域 --> <main class="content-section"> <section class="description"> <h2>活力健身房:城市上空的运动乌托邦</h2> <p>全景落地窗俯瞰草原与城市天际线,配备智能体测系统与专业训练器械,从有氧区到自由重量区私教课程结合蒙式体能训练法,让汗水挥洒成诗。恒温泳池与瑜伽室演绎健身快乐间奏曲,晨起泳姿划破朝阳,暮色中禅定瑜伽随音乐舒展,打造24小时不间断的健康生活场。</p> </section> <section class="rules"> <h3>蒙发国际温泉度假酒店多功能健身房设施使用守则</h3> <ul> <li>1、使用资格与时间</li> <p>-住店客人全天24小时刷卡进入,健身设施仅向住店客人开放。</p> <li>2、使用前准备</li> <p>-使用者需先熟悉各项设施使用说明,熟悉健身器材操作,有疑问可寻求工作人员帮助。</p> <li>3、场地使用规则</li> <p>-遵循先到先得原则,不设预订。</p> <p>-多功能活动室任何时间内最多允许十二名使用者同时在场。</p> <p>-室内不准饮食,需保持整洁。</p> <p>-须穿着合适运动服装及运动鞋,违反者校方有权拒绝其入场。</p> <li>4、健康与安全提示</li> <p>-患高血压、哮喘、心脏病或身体不适者,建议暂停使用。</p> <p>-运动前做10-15分钟热身,运动后做10分钟放松活动。</p> <p>-感到不适或痛楚,立刻停止运动并通知工作人员。</p> <p>-远离摆动中的健身设施或器材。</p> <li>5、器材使用规范</li> <p>-不能改动健身设施或器材原有位置。</p> <p>-有他人等待时,使用器材限时30分钟。</p> <p>-运动后将健身器材放回原处,用消毒剂喷雾擦拭。</p> <p>-操作前检查器材是否正常安全,发现故障/损坏,停止使用并通知酒店,勿自行维修。</p> <p>-损坏或遗失器材需赔偿。</p> <li>6、其他注意事项</li> <p>-未经同意,严禁在场内拍照、录影或录音。</p> <p>-酒店有权预留场地用于维修、清洁、训练班及活动安排。</p> <p>-酒店保留修改规则和规定的权利,恕不另行通知。</p> </ul> </section> </main> <!-- 底部导航栏 --> <Footer /> </div> <!-- 唯一根元素结束 --> </template> <script > import NavBar from '@/components/NavBar.vue'; export default { name: "ftness", data() { return { }; }, }; </script> <style > /* 健身区样式 */ .hero-section { position: relative; height: 60rem ; margin-top: 0rem; /* 补偿固定导航栏高度 */ overflow: hidden; } .hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center; } .hero-title { position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%); color: white; font-size: 3rem; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); margin: 0; } /* 内容区样式 */ .content-section { max-width: 150rem; margin: 2rem auto; padding: 0 5%; line-height:2.4rem; } .description { margin-bottom: 3rem; padding: 2rem; background: #f8f9fa; border-radius: 1rem; font-size: 2.4rem; line-height: 4rem; margin: 6rem auto; font-family: "宋体"; } .rules { margin-top: 3rem; height: 100rem; padding: 2rem; background: white; border-radius: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-size: 2rem; line-height: 3.8rem; font-family: "宋体"; text-align: left; } .rules h3 { color: #007bff; border-bottom: 2px solid #007bff; padding-bottom: 0.5rem; margin-bottom: 1rem; font-size: 2.4rem; text-align: center; } @media (max-width: 768px) { .navbar { flex-direction: column; padding: 1rem 5% 0.5rem; } .nav-left, .nav-right { width: 100%; flex-wrap: wrap; justify-content: center; margin-bottom: 0.5rem; } .nav-item { margin: 0.5rem; } .hero-title { font-size: 2rem; } } </style>
06-18
<template> <div class="label-container"> <div style="border: 1px solid #d9d9d9"></div> <div class="header"> <div class="biaoqian">客户特征标签</div> <el-popover placement="right" popper-class="group-popover" width="287" trigger="click"> <div class="full-label-section"> <span>业务需求</span> <div class="full-tag-group"> <el-popover v-for="(item, index) in requireList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in requireList" v-if="!shouldShowPopover(item)" :key="index" size="mini" >{{ item.labelName }}</el-tag> </div> </div> <div class="full-label-section"> <span>业务特征</span> <div class="full-tag-group"> <el-popover v-for="(item, index) in featureList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" type="" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in featureList" v-if="!shouldShowPopover(item)" :key="index" type="success" size="mini" >{{ item.labelName }}</el-tag> </div> </div> <div class="full-label-section full-label-sections"> <span>拓展任务</span> <div class="full-tag-group"> <el-popover v-for="(item, index) in taskList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" type="danger" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in taskList" v-if="!shouldShowPopover(item)" :key="index" type="danger" size="mini" >{{ item.labelName }}</el-tag> </div> </div> <el-button slot="reference" class="btn">更多</el-button> </el-popover> </div> <!-- 客户特征部分标签 --> <div style="padding: 10px; background: #fafafa"> <div class="label-section"> <span>业务需求</span> <div class="tag-group"> <el-popover v-for="(item, index) in showRequireList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in showRequireList" v-if="!shouldShowPopover(item)" :key="index" size="mini" >{{ item.labelName }}</el-tag> </div> </div> <div class="label-section"> <span>业务特征</span> <div class="tag-group"> <el-popover v-for="(item, index) in showFeatureList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" type="success" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in showFeatureList" v-if="!shouldShowPopover(item)" :key="index" type="success" size="mini" >{{ item.labelName }}</el-tag> </div> </div> <div class="label-section"> <span>拓展任务</span> <div class="tag-group"> <el-popover v-for="(item, index) in showTaskList" :key="index" placement="top-start" popper-class="grid-popover" trigger="hover" :content="item.labelName" v-if="shouldShowPopover(item)" > <el-tag slot="reference" type="danger" size="mini" class="truncate-tag" >{{ item.labelName }}</el-tag> </el-popover> <el-tag v-for="(item, index) in showTaskList" v-if="!shouldShowPopover(item)" :key="index" type="danger" size="mini" >{{ item.labelName }}</el-tag> </div> </div> </div> </div> </template> <script> import { Tag, Button, Popover,Tooltip } from 'element-ui'; export default { name: 'groupLabelBox', components: { [Tag.name]: Tag, [Button.name]: Button, [Popover.name]: Popover, [Tooltip.name]: Tooltip, }, props: { requireList: { type: Array, required: true, }, featureList: { type: Array, required: true, }, taskList: { type: Array, required: true, }, }, data() { return { dialogVisible: false, }; }, computed: { showRequireList() { return this.requireList.slice(0, 2); }, showFeatureList() { return this.featureList.slice(0, 2); }, showTaskList() { return this.taskList.slice(0, 2); }, }, methods: { shouldShowPopover(item) { return item?.labelName?.length >= 7 } }, }; </script> <style lang="less" scoped> .group-popover { padding: 30px !important; /* 标题样式 */ .full-label-section{ padding-bottom: 12px; > span { display: block; margin-bottom: 10px; width: 56px; height: 14px; font-family: PingFangSC, PingFang SC, sans-serif; font-weight: 400; font-size: 14px; color: #888888; line-height: 14px; text-align: left; font-style: normal; } } /* 标签组样式 */ .full-tag-group { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; .el-tag { margin: 0 !important; border-radius: 4px; font-size: 12px; padding: 0 8px; height: 24px; line-height: 24px; } } .full-label-sections { padding-bottom: 0 !important; } } .truncate-tag { display: inline-block; max-width: 112px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; cursor: default; } .truncate-tag:hover:after { position: absolute; top: 30px; left: 10px; content: attr(data-title); color: #333333; } .grid-popover { min-width: 54px; text-align: center; padding: 10px 10px; } .label-container { position: relative; padding: 0px 14px 7px 16px; } .header { display: flex; justify-content: space-between; align-items: center; margin: 10px 0px; .biaoqian { width: 84px; height: 14px; font-family: PingFangSC, PingFang SC, sans-serif; font-weight: 400; font-size: 14px; color: #888888; line-height: 14px; text-align: left; font-style: normal; } .btn { width: 33px; height: 17px; padding: 0 4px; background: #ffffff; border-radius: 2px; border: 1px solid #cbcbcb; font-weight: 400; font-size: 12px; color: #333333; line-height: 17px; font-style: normal; > span { display: block; width: fit-content; } } } .label-section { > span { display: block; margin-bottom: 5px; width: 48px; height: 14px; font-family: PingFangSC, PingFang SC, sans-serif; font-weight: 400; font-size: 12px; color: #333333; line-height: 14px; text-align: left; font-style: normal; } } .tag-group { display: flex; gap: 10px; flex-wrap: wrap; } .label-section:not(:last-child) { margin-bottom: 10px; } </style> 使用vue2+js优化简化以上代码
07-13
<style scoped> /* 基础响应式 */ .filter-container { padding: 10px; } /* 移动端表单项优化 */ @media (max-width: 768px) { .el-form-item { margin-bottom: 15px; } .el-form-item__label { float: none; display: block; text-align: left; padding: 0 0 8px 0; } .el-form-item__content { margin-left: 0 !important; } .mobile-full-width { width: 100%; } /* 解决iOS Safari渲染问题 */ :deep(.el-select) { width: 100%; } } /* 对话框移动端适配 */ :deep(.el-dialog) { @media (max-width: 768px) { width: 90% !important; margin-top: 5vh !important; } } </style> <template> <div class="filter-container"> <el-form :model="searchForm"> <el-row :gutter="15"> <!-- 问卷标题搜索 --> <el-col :xs="24" :sm="12" :md="6"> <el-form-item label="问卷标题"> <el-input v-model="searchForm.dcWjTitle" placeholder="输入问卷标题" clearable /> </el-form-item> </el-col> <!-- 被测评人ID搜索 --> <el-col :xs="24" :sm="12" :md="6"> <el-form-item label="被测评人ID"> <el-input v-model="searchForm.dcid" placeholder="输入被测评人ID" clearable /> </el-form-item> </el-col> <!-- 部门选择 --> <el-col :xs="24" :sm="12" :md="6"> <el-form-item label="人员部门"> <el-select v-model="searchForm.dcDept" placeholder="选择部门" clearable > ... </el-select> </el-form-item> </el-col> <!-- 状态选择 --> <el-col :xs="24" :sm="12" :md="6"> <el-form-item label="提交状态"> <el-select v-model="searchForm.state" placeholder="选择状态" clearable > ... </el-select> </el-form-item> </el-col> <!-- 搜索按钮 --> <el-col :xs="24" :sm="24" :md="6"> <el-form-item> <el-button type="primary" @click="handleSearch" icon="el-icon-search" class="mobile-full-width" >搜索</el-button> </el-form-item> </el-col> </el-row> </el-form> </div> </template> <script> export default { data() { return { searchForm: { dcWjTitle: '', dcid: '', dcDept: '', state: '' }, rawData: [], // 原始数据 departments: [ // 部门选项 { label: '技术部', value: 'tech' }, { label: '市场部', value: 'market' } ] } }, computed: { // 过滤后的数据 filteredData() { return this.rawData.filter(item => (!this.searchForm.dcWjTitle || item.title.includes(this.searchForm.dcWjTitle)) && (!this.searchForm.dcid || item.dcid === this.searchForm.dcid) && (!this.searchForm.dcDept || item.dept === this.searchForm.dcDept) && (!this.searchForm.state || item.state === this.searchForm.state) ) } }, methods: { // 触发搜索 handleSearch() { this.fetchFilteredData() }, // 从后端获取数据 async fetchFilteredData() { try { const params = { title: this.searchForm.dcWjTitle, dcid: this.searchForm.dcid, dept: this.searchForm.dcDept, state: this.searchForm.state } // 调用后端API(示例) const { data } = await axios.get('http://172.26.26.43/dev-api/wjdc/wj/listTx?', { params }) this.rawData = data } catch (error) { console.error('获取数据失败', error) } } } } </script> 为什么这个布局我再电脑网页上打开显示不全
07-15
针对这个Vue项目进行响应式布局调整,主要目标是让页面在不同设备上都能自适应显示:<template> <div class="family"> <!-- 顶部导航栏 --> <NavBar /> <!-- 首页内容区域 --> <div class="content-banner"> <hotel-reservation class="hotel-reservation"></hotel-reservation> </div> <div class="banner-text"> <p class="text" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Family') }}</p> <!-- <span class="top1" >Wedding Banquet & Conference</span> --> </div> <div class="content-wrapper"> <div class="title-box"> <p class="title-zh" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('trip2') }}</p> </div> <!-- 一起脉动 --> <div class="content-box"> <div class="text-box"> <p class="content margin-bottom-20" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('text28') }} </p> <p class="more":class="{ textEn: $i18n.locale === 'en' }">{{ $t('more7') }}</p> </div> <div class="img-box"> <img src="@/assets/wedding/cup.png" alt="" /> </div> </div> <!-- 专业策划 --> <div class="content-box"> <div class="img-box"> <img src="@/assets/wedding/table.png" alt="" /> </div> <div class="text-box"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('Professional') }}</p> <p class="content margin-top-20" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('text20') }} </p> <p class="content"> </p> <p class="more div-center" :class="{ textEn: $i18n.locale === 'en' }">{{$t('more8')}}</p> </div> </div> <!-- 婚宴进行中 --> <div class="content-box"> <div class="text-box"> <p class="title-zh text-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('progress') }}</p> <p class="content margin-top-20" :class="{ textEn: $i18n.locale === 'en' }"> {{ $t('text21') }} </p> <p class="more div-center" :class="{ textEn: $i18n.locale === 'en' }">{{ $t('more9') }}</p> </div> <div class="img-box"> <img src="@/assets/wedding/flower.png" alt="" /> </div> </div> </div> <!-- 底部导航栏 --> <Footer /> </div> </template> <script> export default { name: "family", data() { return { }; }, }; </script> <style scoped> .content-banner { width: 100vw; height: 62rem; margin: 0 auto; background-image: url("@/assets/wedding/flower.png"); background-size: 100% 100%; position: relative; } .hotel-reservation { width: 120rem; height: 12rem; margin: 0 auto; position: relative; top: 45rem; } .content-wrapper { width: 120rem; margin: 0 auto; } .title-box { text-align: center; margin: 6rem 0; } .content-box { display: flex; justify-content: space-between; margin-bottom: 10rem; } .title-en{ font-size: 3rem; font-weight: bold; line-height: 2em; font-family: "Times New Roman", Times, serif; } .textEn { font-family: "Times New Roman", Times, serif !important; } .banner-text { position: absolute; top: 10rem; left: 20%; padding: 1rem 24rem; font-size: 3.2rem; line-height: 2em; font-weight: bold; color: #fff; text-align: center; background-color: rgba(1, 1, 1 1.5); } .text { margin-top: 2rem; font-family: "FangSong"; font-size: 10rem; line-height: 2em; text-align: left; padding: 0 4rem; text-align: justify; -webkit-text-justify: inter-word; text-justify: inter-word; } .top1{ font-family: "Times New Roman", Times, serif; font-size: 6rem; font-weight: bold; } .title-zh { font-size: 4.6rem; /* font-weight: bold; */ color: rgb(202, 171, 98); text-align: left; } .content { width: 60rem; font-size: 2rem; line-height: 2; font-family: "Fangsong"; text-align: justify; } .img-box img { width: 50rem; height: 30rem; } .more { width: 15rem; font-size: 2rem; line-height: 2em; color: rgb(202, 171, 98); text-align: center; cursor: pointer; background-color: rgb(238, 235, 235); } .text-box{ text-align: left; } /* 通用属性 */ /* 文本居中 */ .text-center { text-align: left; } /* div居中 */ .div-center { margin: 5rem auto; text-align: center; } /* 上外边距2rem */ .margin-top-20 { margin-top: 2rem; } /* 下外边距2rem */ .margin-bottom-20 { margin-bottom: 2rem; } /* 页面修改区域 */ /* 响应式调整 */ @media screen and (max-width: 1024px) { .content-banner { height: 70rem; } .hotel-reservation { width: 160rem; top: 54rem; } .content-wrapper { width: 160rem; } .title-en { font-size: 4.8rem; } .title-zh { font-size: 5.6rem; } .content { width: 74rem; font-size: 3rem; } .img-box{ width: 54rem; height: 42rem; } .img-box img { width: 54rem; height: 42rem; } .more { width: 20rem; font-size: 2.4rem; } } @media screen and (max-width: 768px) { .content-banner { height: 82rem; background-image: url("@/assets/wedding/flower.png"); } .hotel-reservation { width: 160rem; top: 66rem; } .content-wrapper { width: 160rem; } .content-box { flex-direction: column; } .img-box { order: 2; } .img-box img { width: 100rem; height: auto; } .text-box { order: 1; } .title-en { font-size: 6rem; } .title-zh { font-size: 6.2rem; } .content { width: 160rem; font-size: 4rem; } .img-box { width: 160rem; height: 90rem; } .more { width: 30rem; font-size: 3.2rem; margin-bottom: 5rem; margin-left: 130rem; } } </style>
07-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值