且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jquery Mobile 自动添加 &nbsp

更新时间:2022-10-14 22:00:43

从他们的网站复制和粘贴源代码时会出现这个问题.

实际上,通过这种方式,您还复制了不可见的空格,这些空格被浏览器转换为   并使最后一个块下降.

要解决这个问题,只需删除标签之间的所有空格,所有内容都会正确显示.

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 ">
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="ui-checkbox">

I've skipped the whole code, the problem is in the

&nbsp;

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 &nbsp; 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.

相关阅读

技术问答最新文章