Mistergreen Mistergreen - 2 months ago 5
CSS Question

JQM navbar last button not align

This is a peculiar thing. The last button is always mis-aligned vertically.

http://jsfiddle.net/5u38gf00/

<div data-role="navbar">    
<ul>      
<li><a href="#one" data-ajax="false">one</a>
</li>      
<li><a href="#two" data-ajax="false">two</a>
</li>      
<li><a href="#three" data-ajax="false">three</a>
</li>    
</ul>
</div>


The code is straight forward from the jqm website. I've checked the css properties and it looks fine.

Answer

Can you just try this http://jsfiddle.net/5u38gf00/1/

I just change the onLoad event to onDomReady event, then it seems work fine

[EDIT]
This will be the simple test code to display desired output in .html page. (Tested local)

<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
    <div data-role="navbar">
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Page Two</a></li>
        <li><a href="#">Search</a></li>
      </ul>
    </div>
</body>
</html>

OutPut:- enter image description here

Comments