首页 > 解决方案 > 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 像素。有任何想法吗?

标签: htmlcss

解决方案


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.


推荐阅读