jQuery Mobile常用CSS类详解

作者:技术拾光时间:2026-08-11 17:17:16浏览:256

jQuery CSS 类 jQuery Mobile 提供了多种 CSS 类,用于为不同元素设置样式。 下面汇总了常见的 CSS 样式类,便于在开发 jQuery Mobile 页面时快速查阅和使用。 全局类 以下全局类可用于 jQuery Mobile 小部件,例如按钮、工具栏、面板、表格和列表等

jQuery CSS 类

jQuery Mobile 提供了多种 CSS 类,用于为不同元素设置样式。

下面汇总了常见的 CSS 样式类,便于在开发 jQuery Mobile 页面时快速查阅和使用。

全局类

以下全局类可用于 jQuery Mobile 小部件,例如按钮、工具栏、面板、表格和列表等元素。

Class 描述
ui-corner-all 为元素添加圆角效果
ui-shadow 为元素添加阴影效果
ui-overlay-shadow 为元素添加多层阴影效果
ui-mini 缩小元素尺寸

按钮类

除了全局类之外,还可以将以下类添加到 或

Class 描述
ui-btn 将 元素显示为按钮样式
ui-btn-inline 让按钮在同一行内显示
ui-btn-icon-top 将图标放置在按钮文本上方
ui-btn-icon-right 将图标放置在按钮文本右侧
ui-btn-icon-bottom 将图标放置在按钮文本下方
ui-btn-icon-left 将图标放置在按钮文本左侧
ui-btn-icon-notext 仅显示图标,不显示文本
ui-btn-a|b 指定按钮主题样式。“a”为默认样式,灰色背景配黑色文本;“b”为黑色背景配白色文本

图标类

以下图标类可用于 和

Class 图标描述 图标
ui-icon-action 动作,一般用于页面跳转或切换 jQuery Mobile常用CSS类详解
ui-icon-alert 三角形内的感叹号 jQuery Mobile常用CSS类详解
ui-icon-audio 音响或音箱 jQuery Mobile常用CSS类详解
ui-icon-arrow-d-l 左下角箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-d-r 右下角箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-u-l 左上角箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-u-r 右上角箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-l 左侧箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-r 右侧箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-u 向上箭头 jQuery Mobile常用CSS类详解
ui-icon-arrow-d 向下箭头 jQuery Mobile常用CSS类详解
ui-icon-back 返回 jQuery Mobile常用CSS类详解
ui-icon-bars 三条水平线,一般用于列表按钮图标 jQuery Mobile常用CSS类详解
ui-icon-bullets 用于列表按钮图标 jQuery Mobile常用CSS类详解
ui-icon-calendar 日历 jQuery Mobile常用CSS类详解
ui-icon-camera 相机 jQuery Mobile常用CSS类详解
ui-icon-carat-d 向下滑动图标 jQuery Mobile常用CSS类详解
ui-icon-carat-l 向左滑动图标 jQuery Mobile常用CSS类详解
ui-icon-carat-r 向右滑动图标 jQuery Mobile常用CSS类详解
ui-icon-carat-u 向上滑动图标 jQuery Mobile常用CSS类详解
ui-icon-check 勾选 jQuery Mobile常用CSS类详解
ui-icon-clock 闹钟 jQuery Mobile常用CSS类详解
ui-icon-cloud 云 jQuery Mobile常用CSS类详解
ui-icon-comment 评论或消息 jQuery Mobile常用CSS类详解
ui-icon-delete 删除 jQuery Mobile常用CSS类详解
ui-icon-edit 编辑或铅笔 jQuery Mobile常用CSS类详解
ui-icon-eye 眼睛 jQuery Mobile常用CSS类详解
ui-icon-forbidden 禁用标识 sign jQuery Mobile常用CSS类详解
ui-icon-forward 撤销,即返回上一步 jQuery Mobile常用CSS类详解
ui-icon-gear 齿轮,一般用于设置按钮图标 jQuery Mobile常用CSS类详解
ui-icon-grid 网格 jQuery Mobile常用CSS类详解
ui-icon-heart 心形,可用于文章收藏 jQuery Mobile常用CSS类详解
ui-icon-home 主页 jQuery Mobile常用CSS类详解
ui-icon-info 信息 jQuery Mobile常用CSS类详解
ui-icon-location 定位 jQuery Mobile常用CSS类详解
ui-icon-lock 锁 jQuery Mobile常用CSS类详解
ui-icon-mail 邮件或信封 jQuery Mobile常用CSS类详解
ui-icon-minus 减号 jQuery Mobile常用CSS类详解
ui-icon-navigation 导航 jQuery Mobile常用CSS类详解
ui-icon-phone 电话 jQuery Mobile常用CSS类详解
ui-icon-power 开关(On/off) jQuery Mobile常用CSS类详解
ui-icon-plus 加号 jQuery Mobile常用CSS类详解
ui-icon-recycle 循环标识 jQuery Mobile常用CSS类详解
ui-icon-refresh 刷新 jQuery Mobile常用CSS类详解
ui-icon-search 搜索或放大镜 jQuery Mobile常用CSS类详解
ui-icon-shop 商店或购物袋 jQuery Mobile常用CSS类详解
ui-icon-star 星形 jQuery Mobile常用CSS类详解
ui-icon-tag 标签 jQuery Mobile常用CSS类详解
ui-icon-user 用户或人物 jQuery Mobile常用CSS类详解
ui-icon-video 视频或摄像机 jQuery Mobile常用CSS类详解

主题类 Classes

jQuery Mobile 默认提供两套主题类:a(灰色)和 b(黑色)。但这并不表示只能使用这两种主题,实际上还可以根据需要自定义主题类,并可扩展到字母 “z”。下表整理了常用主题类。这里的字母(a-z)表示样式类可以从 a 一直到 z,例如 ui-bar-a、ui-bar-b 等。

Class 描述
ui-bar-(a-z) 指定栏目样式,用于头部、底部及其他栏目
ui-body-(a-z) 指定内容块颜色,用于页面内容区域(1.4.0 版本已废弃)、列表视图、弹窗、侧栏、面板、加载和折叠区域
ui-btn-(a-z) 指定按钮颜色
ui-group-theme-(a-z) 定义控制组的样式展示,用于 listviews 和 collapsible 集合
ui-overlay-(a-z) 定义页面背景颜色,包括对话框、弹窗及其他位于顶层的页面容器
ui-page-theme-(a-z) 定义页面样式

网格类

网格中的列采用等宽布局,总宽度为 100%,并且没有边框、背景、margin 或 padding。jQuery Mobile 提供了以下几种网格布局可供使用。

网格类 列 列宽 对应 实例
ui-grid-solo 1 100% ui-block-a
ui-grid-a 2 50% / 50% ui-block-a|b
ui-grid-b 3 33% / 33% / 33% ui-block-a|b|c
ui-grid-c 4 25% / 25% / 25% / 25% ui-block-a|b|c|d
ui-grid-d 5 20% / 20% / 20% / 20% / 20% ui-block-a|b|c|d|e

更多内容可查看 jQuery Mobile 网格章节。