html - HTML 图像宽度似乎是固定的
问题描述
我的页面中有以下图像标签:
<img
style="border-radius: 2em; box-shadow: rgb(204, 204, 204) 3px 3px 8px 1px; height: 250px; width: 370px; overflow: hidden;"
src="evil_dims.jpg"
alt="An illustration of the various mountain bike dimensions">
渲染的图像高度尊重样式,但不尊重宽度,宽度始终固定为 200 像素。有任何想法吗?
解决方案
The elm-hot module that I am using creates a div around my app in development mode, which included a style to limit img tags' max-width
value to 200px. @vsync, thanks for the good tip about some other CSS value causing the issue.
My solution, was just to add a maw-width
style attribute to the image.
推荐阅读
- sql - 从 yyyy-mm-dd 到 mm-yy?
- flutter - Flutter:我们是否被迫在 master 分支上使用 null 安全性?
- notifications - 雪花监控和通知
- forms - Swift UI 表单 - 为什么有这么多空间?
- npgsql - Npgsql 5.0.0.0 事务已完成,不再可用
- c - const 指向传递给函数的 const 字符串的指针
- doctrine-orm - 如何设置依赖于两列及其值的 Doctrine 唯一行?
- python - 循环遍历 Jupyter 目录并将文件名添加到列表中
- docker - Docker 优化容器构建
- php - 为什么当我使用 ++ 运算符将两个变量相加时它返回 2?