2016-11-07 195 views
0

在Firefox中,我的代码可以正常工作,但在Chrome中不起作用。Chrome html/CSS无法正常工作

  • 这是我的Chrome结果:

  • 这是我的Firefox结果:

.welkom { 
 
    color: #ff0007; 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 30px; 
 
} 
 
.informatie { 
 
    float: right; 
 
    margin-top: -250px; 
 
    margin-right: 70px; 
 
}
<div class="informatie"> 
 
    <p class="welkom">naam: Jasper scheper</p> 
 
    <p class="welkom">leeftijd:15</p> 
 
    <p class="welkom">woonplaats: Nieuw-Buinen</p> 
 
    <p class="welkom">email: placeholder</p> 
 
</div>

+1

因为:HTTPS:/ /www.google.nl/search?q=negative%20margin%20chrome – mplungjan

+0

感谢您的回答,但是您知道我可以如何解决这个问题吗? –

+0

阅读搜索答案。有几种方法 – mplungjan

回答

0

我看不出有什么原因,它止跌”从信息工作mation给出,所以我只能建议清除浏览器缓存并再次检查。否则,您的代码可能会有更深层次的问题。

+0

请参阅搜索评论。 Chrome不支持负边距。请获得更多的代表,以便您可以评论,而不是发表评论作为答案 – mplungjan

+0

http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an-i而不是 –

+0

清除缓存是修复!感谢您的帮助和答案! –

0

Chrome不支持负边距值。要达到这种风格,您可以在.informatie类上使用position absolute并调整顶部和右侧值。

实施例:

.informatie { 
    position:absolute; 
    top:300; /* your customised value */ 
    right:0; /* your customised value */ 
} 
0

问题为u使用负边界值,但u能得到元件位置的绝对和相对母体

.welkom { 
 
    color: #ff0007; 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 30px; 
 
} 
 
.informatie { 
 
    float: right; 
 
    margin-top: 0px; 
 
    margin-right: 70px; 
 
}
<div class="informatie"> 
 
    <p class="welkom">naam: Jasper scheper</p> 
 
    <p class="welkom">leeftijd:15</p> 
 
    <p class="welkom">woonplaats: Nieuw-Buinen</p> 
 
    <p class="welkom">email: placeholder</p> 
 
</div>