<el-row style="display:flex;justify-content:lift;align-items:center;width: 100%; height: 100%"> <el-col style="display:flex;justify-content:lift;align-items:center;width: 100%; height: 100%;"> <el-card class="card-box" style="display:flex;width=200px;height=110px;border-radius: 10px;"> card1 </el-card> </el-col> <!-- <el-col style="display:flex;justify-content:lift;align-items:center;width: 200px; height: 200px"> <el-card style="display:flex;width=200px;height=100px">card2</el-card> </el-col> --> </el-row>为什么我设置的card高度与宽度不起作用
时间: 2024-04-29 11:20:15 浏览: 155
你设置的card高度与宽度不起作用可能是因为你在样式中使用了等于号(=)而不是冒号(:)。正确的写法应该是:`width: 200px; height: 110px;`。此外,你的样式中还存在一些拼写错误,例如 `justify-content:lift` 应该是 `justify-content: left`。你可以修改这些错误后再尝试一下是否能够正确设置card的高度与宽度。
相关问题
<el-col :span="6" :xs="24"> <div class="card-list" style="display: flex;width: 100%;flex-wrap: wrap;justify-content: space-between; align-items: center;"> <!--div style="display: flex; justify-content: space-between; align-items: center;"--> <!--el-card style="margin-bottom:20px; width:300px;height:280px"--> <el-card style="width:300px;height:280px; margin-left:1px;margin-bottom: 10px"> <template #header> <div class="h-4 pl-[90px]" style="width: 100%;display: flex;justify-content: space-between; align-items: center;"> <div class="user-block" style="line-height: 30px;font-size: 20px;"> <span class="username text-muted" style="margin-left: 10px;">故障模拟设备</span> <span class="description" style="margin-left: 10px;">教学理论设备</span> </div> <el-tag class="username text-muted" style="margin-left: 10px;color:green">运行</el-tag> <div class="el-icon-setting" style="font-size: 25px; color: rgba(18, 21, 211, 0.829);" @click="update"></div> </div> </template> <div class="flex justify-center" style="display: flex;width: 100%;flex-wrap: wrap;justify-content: space-between; align-items: center;"> <img class="rightullidiv" :src="'../../../static/images/fan.gif'"> <!--img class="w-[100px] h-[100px] rounded-lg" src="'../../../static/images/fan.gif'" alt=""--> <div class="ml-3" style="width:120px;height:280px; margin-left:1px;margin-bottom: 10px"> <!--el-descriptions class="el-descriptions__body" size="small" :column="Number('1')" border--> <el-descriptions size="small" :column="Number('1')" border> <el-descriptions-item label="电压">380 V</el-descriptions-item> <el-descriptions-item label="电流">10 A</el-descriptions-item> <el-descriptions-item label="通讯">正常 </el-descriptions-item> </el-descriptions> </div> </div> </el-card> </div> </el-col>实现图片与el-descriptions-item label="电压"并排放置,如何修改代码
您可以将图片与el-descriptions-item label="电压"都放在一个div中,设置该div的display属性为flex,并设置justify-content为space-between或者space-around。具体代码如下:
```
<div class="flex justify-between">
<img class="rightullidiv" :src="'../../../static/images/fan.gif'">
<el-descriptions size="small" :column="Number('1')" border>
<el-descriptions-item label="电压">380 V</el-descriptions-item>
</el-descriptions>
</div>
```
您可以将以上代码替换掉原来的el-descriptions代码部分即可。
<el-select v-model="form.productAttr" placeholder="框架类型" clearable style="width:200px;" > <!-- style="width: 200px;display:flex;flex-direction: row;flex-wrap: wrap;justify-content: center;align-items: center;" --> <el-option v-for="dict in productAttr" :key="dict.value" :label="dict.label" :value="dict.value" style="width:90px;margin-left:5px;margin-right:5px;display:inline-block;text-align: center;" /> </el-select>帮我改成,每三个el-option在同一列
<-select
v-model="form.productAttr"
placeholder="框架类型"
clearable
style="width:200px;"
>
<template v-for="(dict, index) in productAttr">
<el-option
:key="dict.value"
:label="dict.label"
:value="dict.value"
:style="{
'width': '90px',
'margin-left': index % 3 === 0 ? '0' : '5px',
'margin-right': index % 3 === 2 ? '0' : '5px',
'display': 'inline-block',
'text-align': 'center'
}"
/>
</template>
</el-select>
阅读全文