我试图让我的清单看起来像this:
![enter image description here](https://i.stack.imgur.com/o2tXA.png)
但它看起来像这样:
![enter image description here](https://i.stack.imgur.com/IlMFR.png)
我已经复制了直接来自 jQuery 移动网站的代码:
<ul data-role="listview" data-autodividers="true" data-filter="true" data-inset="true">
<li><a href="index.html">Adam Kinkaid</a></li>
<li><a href="index.html">Alex Wickerham</a></li>
<li><a href="index.html">Avery Johnson</a></li>
<li><a href="index.html">Bob Cabot</a></li>
<li><a href="index.html">Caleb Booth</a></li>
<li><a href="index.html">Christopher Adams</a></li>
<li><a href="index.html">Culver James</a></li>
</ul>
我的包有 js 和 css 文件:
bundles.Add(
new ScriptBundle("~/scripts/vendor")
.Include("~/scripts/jquery-{version}.js")
.Include("~/scripts/jquery.mobile-{version}.js")
bundles.Add(
new StyleBundle("~/Content/css")
.Include("~/Content/ie10mobile.css")
.Include("~/Content/jquery.mobile-{version}.css")
.Include("~/Content/jquery.mobile.structure-{version}.css")
.Include("~/Content/jquery.mobile.theme-{version}.css")
但是,我无法让我的列表看起来像它应该的那样。我可能会错过什么?
注意:在 chrome 中查看 F12 窗口时,我没有看到任何错误,但窗口右下角有一个小警告图标:
![enter image description here](https://i.stack.imgur.com/g7Dln.png)
但当我点击它时什么也没有发生。我还将相同的代码粘贴到 jsfiddle.net 中,它在那里工作得很好。我只是无法让它在我的应用程序中工作。
编辑 - jQuery 版本
![enter image description here](https://i.stack.imgur.com/nzHeX.png)
编辑 2 - 错误?
我刚刚在开发者工具中注意到了这一点。难道这跟这有什么关系吗?删除线是否意味着浏览器在加载某些内容时遇到问题?
![enter image description here](https://i.stack.imgur.com/UEZOS.png)
编辑 3 - 热毛巾结构导致问题?
如果我将相同的 HTML 放入我的 index.cshtml 文件中,它就可以工作。但是,当我尝试将其放入任何热毛巾视图(应用程序文件夹、视图文件夹)时,它只是不渲染。也许该文件夹结构中存在某些不允许找到 css 的内容?
编辑 4 - 查看源代码,了解它何时工作与何时不工作
如果我将列表放在 index.cshtml 上并在开发工具中检查它,我可以看到应用的所有样式:
![enter image description here](https://i.stack.imgur.com/c9UXU.png)
但在另一个视图上(在 app\views 文件夹中),它很简单:
![enter image description here](https://i.stack.imgur.com/CAMGA.png)
编辑 5 - index.cshtml 上使用的 CSS
我在index.cshtml 和apps.html 上有相同的列表。这些样式显示在index.cshtml 上的列表中,但在apps.html 上的列表中不存在。对于apps.html,并不是样式被划掉了,而是它们不存在了。
![enter image description here](https://i.stack.imgur.com/tdzxE.png)