强制标题在 html 中换行
我有一个显示 pdf 文档的网页。标题中有一个图像和一个包含名称的 h1 标签。当名字太长时,它就会被切断。如何强制它换行到下一行,以便显示整个名称?我尝试插入 style="white-space:normal"
但没有帮助。有什么建议吗?
I have a web page that displays a pdf document. In the header there is an image and an h1 tag that contains a name. When the name is too long, it gets cut off. How can I force it to wrap to the next line instead so that the entire name is displayed? I tried inserting a style="white-space:normal"
but it doesn't help. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
它应该是两者的结合:
感谢 Tor 和 Alex :)
It should have the combination of two:
thanks to Tor and Alex :)
h1
标签默认换行。如果不是,则 CSS 中的某些内容会覆盖该默认行为。如果您可以发布该网站的链接,我们可以快速帮助您。您可能需要考虑安装适用于 Firefox 的 Firebug - 它可以让您右键单击h1
并查看对其应用了哪些样式以及它们来自何处。h1
tags wrap by default. If they're not, something in your CSS is overriding that default behaviour. If you can post a link to the site, we can quickly help you out. You might want to consider installing Firebug for Firefox - it'll let you right-click on theh1
and view what styles are being applied to it, and from where they come.标头是否包含在另一个元素(例如 div)中?如果是这样,请检查该元素的溢出和/或尝试将其设置为可见,如下所示:
Is the header contained wihtin another element such as a div? If so, check the overflow for that element and/or try setting it to visible like this:
h1
标签的行高为零the
h1
tag has a zero line height