gpt4 book ai didi

html - 使用对话框显示图片

转载 作者:行者123 更新时间:2023-12-05 07:50:21 25 4
gpt4 key购买 nike

我想做的是显示缩略图,当您单击它时,图片会以全尺寸显示(在对话框内)。

我所能得到的要么是一张不适合对话框的图片,要么是一个比图片宽的对话框。

关于如何实现这一目标的任何想法?

没有风格的当前结果(你看到两侧的电梯):

enter image description here

编辑对话框的代码:

<md-dialog aria-label="Picture" class="dialog-picture">
<md-dialog-content>
<div>
<img src="images/random.jpg" alt="image at full size">
</div>
</md-dialog-content>
</md-dialog>

EDIT 属性 max-width 设置为:

enter image description here

编辑:到目前为止我得到了这个:enter image description here

我通过删除其最大高度值 (scss) 更改了对话框样式:

.dialog-picture {
max-height: none;
img {
max-width: 100%;
max-height: 100%;
}
}

最佳答案

img {
display: block;
max-width: 100%;
height: auto;
}

关于html - 使用对话框显示图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36285262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com