verticalAlign 图片文字相对位置
详细代码
vue
<script setup>
import { ref } from 'vue'
import { ElRadioGroup, ElRadio } from 'element-plus'
const select = ref("auto");
const options = ref([
"auto",
"baseline",
"bottom",
"middle",
"sub",
"super",
"text-bottom",
"text-top",
"top"
])
</script>
<template>
<div class="container">
<img src="/images/favicon.png" class="img" :style="{ 'verticalAlign': select }" />
<span>安能摧眉折腰事权贵,使我不得开心颜</span>
</div>
<br>
<el-radio-group v-model="select">
<el-radio v-for="item in options" :key="item" :value="item">
{{ item }}
</el-radio>
</el-radio-group>
</template>
<style scoped lang="scss">
.container {
width: 100%;
margin-top: 20px;
.img {
display: inline;
}
}
label {
width: 100%;
}
</style>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46