hookehuyr

图片高度样式修改

<!--
* @Date: 2024-10-17 09:22:56
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-21 16:55:32
* @LastEditTime: 2024-10-24 14:43:28
* @FilePath: /hager/src/views/about/index.vue
* @Description: 文件描述
-->
<template>
<div class="hager-about-page">
<hager-box class="top-img" :style="{ height: top_img_height, backgroundImage: 'url(https://cdn.ipadbiz.cn/hager/banner/banner04@2x.png)' }">
<div v-if="!is_xs" class="banner-text-wrapper top-center">
<hager-box :class="['top-img', is_xs ? 'xs' : '']" :style="{ backgroundImage: 'url(https://cdn.ipadbiz.cn/hager/banner/banner04@2x.png)' }">
<div v-if="!is_xs" class="banner-text-wrapper" style="margin-top: 8%;">
<div class="text">
<p class="title">海格E3可持续发展理念</p>
<p class="sub">Ethics 道德</p>
......@@ -134,6 +134,10 @@ export default {
background-size: cover;
background-position: center;
position: relative;
height: 25rem;
&.xs {
height: 12rem;
}
.top-center {
position: absolute;
transform: translateY(100%); /* 垂直与水平居中 */
......
<!--
* @Date: 2024-10-18 12:05:44
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-23 14:36:19
* @LastEditTime: 2024-10-24 14:42:28
* @FilePath: /hager/src/views/news/index.vue
* @Description: 文件描述
-->
<template>
<div class="hager-news-page">
<hager-box :class="['top-img', is_xs ? 'xs' : '']" :style="{ backgroundImage: 'url(https://cdn.ipadbiz.cn/hager/banner/banner04@2x.png)' }">
<hager-box :class="['top-img', is_xs ? 'xs' : '']" :style="{ backgroundImage: 'url(https://cdn.ipadbiz.cn/hager/banner/banner06.png)' }">
<div v-if="!is_xs" class="banner-text-wrapper top-center">
<div class="text">
<p class="title" style="margin-bottom: 0;">新闻中心</p>
......@@ -110,7 +110,7 @@ export default {
}
.top-center {
position: absolute;
transform: translateY(50%); /* 垂直与水平居中 */
transform: translateY(100%); /* 垂直与水平居中 */
}
}
......