字段集中的锚标记垂直居中

发布于 2024-07-10 20:39:26 字数 54 浏览 3 评论 0原文

我试图使用 CSS 将锚点在字段集中垂直居中,但它似乎总是与底部对齐。 这其中有什么技巧吗?

I am trying to vertically center an anchor within a fieldset using CSS but it always appears to align to bottom. Is there any tricks to this?

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

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

发布评论

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

评论(3

眼藏柔 2024-07-17 20:39:26

您在这里没有提供太多细节。 除了行高之外,您可能还需要调整顶部和底部填充。 这完全取决于字段集中有多少内容。

You are not giving too much detail here. Besides the line-height you might also want to tweak top and bottom padding. It all depends on how much stuff you have inside the fieldset.

恰似旧人归 2024-07-17 20:39:26

您是否尝试过为文本指定行高? 它应该有助于在 Firefox 和 IE 中保持一致。

Have you tried specifying a line-height for the text? It should help to align in both Firefox and IE.

梦亿 2024-07-17 20:39:26

尝试设置样式 vertical-align:middle;

<a href="www.google.com" style="vertical-align:middle;">google</a>

如果这不起作用,发布您的 HTML 会有所帮助

Try setting the style vertical-align:middle;

<a href="www.google.com" style="vertical-align:middle;">google</a>

If that doesn't work posting your HTML would be helpful

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