简体   繁体   English

jQuery Mobile工具栏的高度

[英]Height of Toolbar of jQuery Mobile

the height of the toolbar in my project is somehow not right. 我项目中工具栏的高度不正确。 I tried many possibilities, went back to an index.html which had nothing but the toolbar. 我尝试了很多可能性,然后回到了index.html,除了工具栏外什么也没有。 And even then it has this wrong height: 即使这样,它的高度仍然错误:

截图

The height should be the same like button - but it is not. 高度应与按钮一样,但高度不能相同。 There is nothing changed on css or js of jQuery mobile, just downloaded and imported. jQuery mobile的css或js上没有任何更改,只需下载并导入即可。

Any Idea why it looks this way? 知道为什么会这样吗? It is not dynamic, seems like it is a hardcoded height. 它不是动态的,似乎是一个硬编码的高度。 Changing the height of the toolbar in CSS leads to a wrong positioning of the text. 在CSS中更改工具栏的高度会导致文本的位置错误。

Ok, jQuery UI is actually generating some &nbsp in the header. 好的,jQuery UI实际上在标题中生成了一些&nbsp That's why you have all this "extra" space. 这就是为什么您拥有所有这些“额外”空间的原因。

As explained here , you have to remove the spaces between the tags and all will be displayed correctly. 正如解释在这里 ,你必须删除标记之间的空间,一切都将正确显示。

https://jsfiddle.net/k4502jLq/1/ https://jsfiddle.net/k4502jLq/1/

Also, if you are using Sublime Text , you should have a look on Trailing Spaces , which remove all this kind of "non-desired" spaces automatically when you save you file. 另外,如果您使用Sublime Text ,则应查看Trailing Spaces ,它在保存文件时会自动删除所有此类“非所需”空间。 Very useful. 很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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