我有以下基本的HTML内容:
<div> <a href="..."> <img src="..." width="81" height="75" ... /> </a> </div>事实上,“A”标签的高度仅为19px,而图像元素的高度设置为75px。
即使我手动将“A”标签的高度设置为75px,它也不会被设置并保持不变。
围绕“A”标签的“DIV”元素获取“IMG”元素的确切尺寸,无需手动或任何地方设置。
浏览器是Chrome,最新版本。
如何正确设置“A”标签的高度,因此它总是覆盖(自动)整个“IMG”元素?
I have the following basic HTML content:
<div> <a href="..."> <img src="..." width="81" height="75" ... /> </a> </div>De-facto, the height of the "A" tag is only 19px, while the image element is set to 75px.
Even when I set the height of the "A" tag manually to 75px, it doesn't get set and stays as is.
The "DIV" element surrounding the "A" tag gets the exact dimensions of the "IMG" element, without setting it manually or anywhere.
The browser is Chrome, latest version.
How do I set the height of the "A" tag correctly, so it always covers (automatically) the entire "IMG" element??
最满意答案
尝试将display:inline-block添加到<a>元素。
Try adding display:inline-block to the <a> element.
更多推荐
IMG,元素,标签,px,电脑培训,计算机培训,IT培训"/> <meta name="description"
发布评论