【问题标题】:Sub-header in jQuery Mobile?jQuery Mobile 中的子标题?
【发布时间】:2013-02-11 14:25:17
【问题描述】:

header 创建一个jQuery Mobile popup,默认效果很好(我想有一天解决那个非圆形的左上角):

<div data-role="header">
  <h1>Useful Header</h1>
</div>

添加子标题的正确方法是什么?子标题是指类似于标题的文本,但更小,可能在标题和子标题之间留有较小的边距。

Google 帮不上什么忙,这种天真的尝试失败了:

<div data-role="header">
  <h1>Useful Header</h1>
  <h6>Simple Sub-header</h6>
</div>

【问题讨论】:

  • jQuery Mobile 有其局限性。如果你想实现这一点,要么覆盖 jqm css,要么创建自己的数据角色。

标签: jquery-mobile popup


【解决方案1】:

这是一种使用 CSS 获得所需布局的方法:

<div data-role="header">
  <h1>Useful Header</h1>
  <p class="popup-subheader">Simple Sub-header</p>
</div>
.popup-subheader {
  text-align: center;
  margin-top: -5px;
  margin-bottom: 6px;
  font-size: smaller;
  font-weight: normal;
}

【讨论】:

    猜你喜欢
    • 2020-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多