尽管声明了属性,但 href 标签的高度为 0

发布于 2024-11-23 18:57:32 字数 376 浏览 7 评论 0原文

所有,

在我的网站 www.coutallure.com

,在“密码”正下方有一个“忘记密码”div ' 页面底部的字段。

现在,尽管如此,我已经指定了高度和高度。 div (id: fpass) 的宽度,该 div 内的“a href”标签不会继承父 div (fpass) 的高度。

我已经指定了高度和高度'a href' 标签的宽度以及根据 firebug,高度和宽度。浏览器正在考虑宽度,但是“a href”标签的高度仍然为零!

谁能告诉我为什么会这样,即高度和高度? “a href”标签的宽度不是实际高度&浏览器使用的宽度?

All,

On my website www.coutallure.com

There is a 'forgot password' div thats sitting right underneath the 'password' field at the bottom of the page.

Now, even though, I have specified the height & width of the div (id: fpass), the 'a href' tag inside this div doesnt inherit the height from the parent div (fpass).

I have specified the height & width of the 'a href' tag as well and as per the firebug, the height & width is being taken into consideration by the browser, however still, the height of the 'a href' tag remains zero!

Can anyone please enlighten me why this is the way it is, i.e. the height & width of the 'a href' tag is not the actual height & width being used by the browser?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昵称有卵用 2024-11-30 18:57:32

a 元素默认是内联的,添加 display: block 以使其监听其尺寸。

内联元素不会监听使用 CSS 设置的尺寸。

jsFiddle

An a element is inline by default, add display: block to make it listen to its dimensions.

An inline element won't listen to its dimensions set with CSS.

jsFiddle.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文