1.代码
<template>
<div class="pageD">
<div class="title">
<h1>I am admin</h1>
</div>
</div>
</template>
<script setup lang="ts"></script>
<style scoped lang="less">
.pageD {
width: 1000px;
height: 400px;
--b: url("src/assets/xi_an.jpeg") no-repeat center/cover;
background: var(--b);
background-size: 100% 100%;
.title {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
h1 {
display: inline-block;
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: transparent;
-webkit-text-stroke: 1px #fff;
font-size: 6vw;
background: var(--b);
background-size: 100% 100%;
background-clip: text;
}
}
</style>