『瀚思彼岸』» 智能家居技术论坛
标题:
求教 关于蘑菇卡片图片大小调整的问题
[打印本页]
作者:
uu7711
时间:
2025-7-22 00:07
标题:
求教 关于蘑菇卡片图片大小调整的问题
type: custom:mushroom-template-card
entity: fan.zhimi_cn_271052863_va1_s_2_air_purifier
secondary: ""
picture: |-
{% set status = state_attr(entity,'preset_mode') %}
{%
if status == "最爱" and is_state(entity, 'on') %}
/local/home/icon/red_fan.gif {% elif status == "自动" and is_state(entity, 'on') %}
/local/home/icon/fan.gif {% elif status == "睡眠" and is_state(entity, 'on') %}
/local/home/icon/night_fan.gif {% else %} /local/home/icon/fan_off.png {% endif %}
primary: ""
style:
top: 21%
left: 32.5%
card_mod:
style: |
ha-card {
background: transparent !important;
border: 0px solid #333333 !important;
padding:0px !important;
}
ha-card img{
width: 10px !important;
height: 10px !important;
object-fit: contain !important;
}
复制代码
请问下各位大佬 上面代码中图片的大小怎么通过ha-card来控制? 蘑菇卡片css选择器是怎么确定的?
作者:
relliky
时间:
2025-7-22 00:33
本帖最后由 relliky 于 2025-7-22 00:34 编辑
关于CSS, 在游览器里按F12,一点点的找到CSS代码,直接修改就可以看到效果了。如果确认了效果,再把要改的代码放回yaml就好。
我之前花了一个下午和晚上,写了个灯光的卡片。
https://bbs.hassbian.com/thread-22726-1-1.html
作者:
uu7711
时间:
2025-7-22 12:38
relliky 发表于 2025-7-22 00:33
关于CSS, 在游览器里按F12,一点点的找到CSS代码,直接修改就可以看到效果了。如果确认了效果,再把要改的 ...
感谢 已解决
欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/)
Powered by Discuz! X3.5