jquery - jquery mobile 中的导航栏图标问题

标签 jquery html css jquery-ui jquery-mobile

我需要为我的导航栏添加图标,所以我从以下链接下载了图标,http://www.glyphish.com/ , 我已经下载了免费图标。然后我试图在代码中添加图标,我的缺点不显示?代码有什么问题?

<div data-role="navbar">
                <ul>
                    <li><a id="other-color" data-icon="img/193-location-arrow.png" data-iconpos="left" href="#">Set Filter</a></li>
                    <li><a id="other-color" data-icon="img/193-location-arrow.png" data-iconpos="right" href="#">Add page</a></li>
                </ul> 

截图: enter image description here

最佳答案

创建自定义类并使用 :after 伪选择器修改它们的 background-image

.ui-arrow:after {
  background-image: url(../193-location-arrow.png);
  background-size: 15px 15px;
}

.ui-location:after {
  background-image: url(../07-map-marker.png);
  background-size: 20px 20px;
}

Demo

关于jquery - jquery mobile 中的导航栏图标问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24578278/

相关文章:

javascript - 如何将 javascript 对象格式化为模式数据的 JSON 对象?

javascript - 增加变量

javascript - 完整日历删除数据库中外部事件的编辑描述

html - 布局表?为什么不?

php - 如何用php检测当前页面?

javascript - 使用 JQuery 将未格式化的 JSON 文本添加到 ACE Editor Div

html - Css3 flex 属性元素在布局上对齐

javascript - 自动滚动到可滚动 div 中的元素

css - 如何在一个div中添加2个重叠元素?

jquery - 使用 jQuery tablesorter 排除某列的排序