简体   繁体   中英

JQuery Mobile Navbar is bugging

When I want to make a Navbar with JQM, the system is adding unnecessary &nbsp into the grid, which makes the navbar look weird.

I am using JQM 1.4.5 and Jquery 1.11.2.

Code:

<div id="home" data-role="page">
  <h1>Content</h1>
  <div data-role="footer">
    <div data-role="navbar">
      <ul>
        <li><a href="#" class="ui-btn-active">One</a></li>
        <li><a href="#">Two</a></li>
      </ul>
    </div><!-- /navbar -->
  </div>
</div>

Browser:

在此处输入图片说明

For people who are seeing this and having the same problem: If you copy the code for the widgets from the JQuery Mobile Demos, there are spaces between the tags which you will see in the browser. Delete them and it should look normal again.

Having the second tab dropped blow like that maybe caused by your css. Try using display: inline-block or even floats to get those items to align correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM