Jquery Mobile 自动添加 &nbsp [英] Jquery Mobile automatically adds &nbsp
问题描述
我使用 Jquery Mobile 获得了此代码:
<form action="/" method="post"><fieldset data-role="控制组"><input type="checkbox" name="checkbox-1a" id="checkbox-1a" 选中=""><label for="checkbox-1a">Cheetos</label><input type="checkbox" name="checkbox-2a" id="checkbox-2a"><label for="checkbox-2a">Doritos</label><input type="checkbox" name="checkbox-3a" id="checkbox-3a"><label for="checkbox-3a">Fritos</label><input type="checkbox" name="checkbox-4a" id="checkbox-4a"><label for="checkbox-4a">Sun Chips</label></fieldset></表单>
问题是,当我加载页面时,代码如下所示:
<div class="ui-checkbox">我跳过了整个代码,问题出在
那不应该在那里.知道如何修复它吗?
解决方案 从他们的网站复制和粘贴源代码时会出现这个问题.
实际上,通过这种方式,您还复制了不可见的空格,这些空格被浏览器转换为
并使最后一个块下降.
要解决这个问题,只需删除标签之间的所有空格,所有内容都会正确显示.
i've got this code using Jquery Mobile :
<div role="main" class="ui-content">
<form action="/" method="post">
<fieldset data-role="controlgroup">
<input type="checkbox" name="checkbox-1a" id="checkbox-1a" checked="">
<label for="checkbox-1a">Cheetos</label>
<input type="checkbox" name="checkbox-2a" id="checkbox-2a">
<label for="checkbox-2a">Doritos</label>
<input type="checkbox" name="checkbox-3a" id="checkbox-3a">
<label for="checkbox-3a">Fritos</label>
<input type="checkbox" name="checkbox-4a" id="checkbox-4a">
<label for="checkbox-4a">Sun Chips</label>
</fieldset>
</form>
</div>
The problem is that when i load the page the codes looks like this :
<div class="ui-controlgroup-controls ">
<div class="ui-checkbox">
I've skipped the whole code, the problem is in the
that should not be there.
Any idea about how to fix it?
解决方案 This problem comes when copying and pasting the source code from their website.
In fact in this way you copy also invisible blank spaces which are converted as
by the browser and make the last block go down.
To solve the issue simply remove all the spaces between the tags and all will be displayed correctly.
这篇关于Jquery Mobile 自动添加 &nbsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文