将文本换行在列表项/按钮中,而不是隐藏溢出

发布于 2024-10-05 12:16:49 字数 211 浏览 0 评论 0原文

我试图覆盖 jQuery Mobile 中列表项和按钮的默认行为,其中的文本不适合一行作为隐藏溢出。

如果您在浏览器窗口或 iPhone 上查看此内容,您就会明白我的意思:http://m.gizmag.com

我'我希望能够将每个列表项的 h3 和 p 标记中的文本换行到新行。

提前致谢!

I'm trying to override the default behavior of list items and buttons in jQuery Mobile, which has text which doesn't fit on one line as hidden overflow.

If you view this on a skinny browser window or iPhone you'll see what I mean: http://m.gizmag.com

I'd like to be able to wrap the text in the h3 and p tags of each list item onto new lines.

Thanks in advance!

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

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

发布评论

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

评论(2

你曾走过我的故事 2024-10-12 12:16:49

Try setting a style of white-space:normal for the elements.

I just did this with an anchor (<a>) element inside a jQuery Mobile listview-styled li, and it worked to wrap the text as I expected. I used Chrome's developer tools to determine where the CSS attributes were coming from and interactively changed them to make it work the way I wanted.

--
Derek

巴黎盛开的樱花 2024-10-12 12:16:49

如果可行,将其包含在

内也会使其换行。 (但是找到受影响的元素并声明 white-space:normal 是更合适的解决方案)

来源:http://forum.jquery.com/topic/list-items-are-truncating-text-is-there-a -绕过这个

If feasible, enclosing it inside a <div> will also make it wrap. (But finding the affected element and declaring white-space:normal is the more proper solution)

Source: http://forum.jquery.com/topic/list-items-are-truncating-text-is-there-a-way-around-this

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