页面中没有任何理由的新行 [英] New line in page for no reason

查看:95
本文介绍了页面中没有任何理由的新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站更新了我的横幅广告。
在边距上有无法解释的情况(左边第一个和第二个左边之间)。
边距是HTML中的新行,但没有任何推子元素来保存它。
这很奇怪。



我试图设置一个 jsfiddle ,但该错误不存在。



以下是代码:

 < br> 
< div class =invisible_box>
< a class =overlayonclick =window.open('http://www.s-maof.com/LandingPages/PRO/','PRO','scrollbars=yes,toolbar = no ,status = no,width = 570,height = 650')>< / a>
< object type =application / x-shockwave-flashdata =http://s-maof.com/stuff/bannerPro150x75.swfwidth =150height =75>
< param name =movievalue =http://s-maof.com/stuff/bannerPro150x75.swf/>
< param name =qualityvalue =high/>
< param name =wmodevalue =transparent/>
< param name =loopvalue =false/>
< / object>
< / div>

< div class =invisible_boxstyle =z-index:7000>
< a class =overlaystyle =cursor:auto;>< / a>
< object type =application / x-shockwave-flashdata =http://s-maof.com/stuff/tachlit-150x150.swfwidth =150height =150> ;
< param name =movievalue =http://s-maof.com/stuff/tachlit-150x150.swf/>
< param name =qualityvalue =high/>
< param name =wmodevalue =transparent/>
< param name =loopvalue =false/>
< / object>
< / div>

和CSS:



  .invisible_box {
height:75px;
margin-bottom:5px;
职位:亲属;
width:150px;
}
.overlay {
背景:无重复滚动0 0白色;
display:block;
height:75px;
剩下:0;
opacity:0;
位置:绝对;
top:0;
width:150px;
z-index:10000;


解决方案

href =http://www.fileformat.info/info/unicode/char/200b/index.htm =nofollow> U + 200B div之后的字符,它们可能是原因。源代码显示了这一点(查看文本编辑器,您可以看到这些):

 < div class =invisible_box > 
< a class =overlayonclick =window.open('http://www.s-maof.com/LandingPages/PRO/','PRO','scrollbars=yes,toolbar = no ,status = no,width = 570,height = 650')>< / a>
< object type =application / x-shockwave-flashdata =http://s-maof.com/stuff/bannerPro150x75.swfwidth =150height =75>
< param name =movievalue =http://s-maof.com/stuff/bannerPro150x75.swf/>
< param name =qualityvalue =high/>
< param name =wmodevalue =transparent/>
< param name =loopvalue =false/>
< / object>
< / div>< U + 200B>< U + 200B>< U + 200B>

正如Tiby指出的,它们可能会导致您在Chrome控制台上看到的流氓元素。

I have updated my banners in my site. There are unexplainable over margins (between the first from the left and the second from the left.) The margin is a new line in the HTML, but without any fader element to hold it. It's weird.

I have tried to set up a jsfiddle, but the error does not exist there.

Here is the code:

<br>
<div class="invisible_box">
    <a class="overlay" onclick="window.open('http://www.s-maof.com/LandingPages/PRO/','PRO','scrollbars=yes, toolbar=no,status=no, width=570,height=650')"></a>
    <object type="application/x-shockwave-flash" data="http://s-maof.com/stuff/bannerPro150x75.swf" width="150" height="75">
        <param name="movie" value="http://s-maof.com/stuff/bannerPro150x75.swf" />
        <param name="quality" value="high" />
        <param name="wmode" value="transparent" />
        <param name="loop" value="false" />
    </object>
</div>

<div class="invisible_box" style="z-index: 7000">
    <a class="overlay" style="cursor:auto;"></a>
    <object type="application/x-shockwave-flash" data="http://s-maof.com/stuff/tachlit-150x150.swf" width="150" height="150">
        <param name="movie" value="http://s-maof.com/stuff/tachlit-150x150.swf" />
        <param name="quality" value="high" />
        <param name="wmode" value="transparent" />
        <param name="loop" value="false" />
   </object>               
</div>

And the CSS:

.invisible_box {
    height: 75px;
    margin-bottom: 5px;
    position: relative;
    width: 150px;
}
.overlay {
    background: none repeat scroll 0 0 white;
    display: block;
    height: 75px;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    width: 150px;
    z-index: 10000;
}  

解决方案

You have three invisible U+200B characters after the div, and they may be the cause. The source code shows this (look in a text editor that allows you to see those):

<div class="invisible_box">
    <a class="overlay" onclick="window.open('http://www.s-maof.com/LandingPages/PRO/','PRO','scrollbars=yes, toolbar=no,status=no, width=570,height=650')"></a>
    <object type="application/x-shockwave-flash" data="http://s-maof.com/stuff/bannerPro150x75.swf" width="150" height="75">
        <param name="movie" value="http://s-maof.com/stuff/bannerPro150x75.swf" />
        <param name="quality" value="high" />
        <param name="wmode" value="transparent" />
        <param name="loop" value="false" />
    </object>
</div>​​​<U+200B><U+200B><U+200B>

They may be causing the rogue element you see on Chrome Console, as pointed out by Tiby.

这篇关于页面中没有任何理由的新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆