2010-01-05 69 views
0

我试图做一个无限的圆角矩形,但我不能似乎得到顶遵守...继承人是什么样子... http://animactions.ca/Animactions/accueil.php顶不工作圆角矩形的

你会发现圆形矩形的底部是好的,但我一直在努力几个小时才能找出顶部。由于

对不起,该网站上传失败了,现在它是由问题

图片http://img511.imageshack.us/img511/6272/probleml.png

的Html

<div id="page_content"> 
<div id="top">&nbsp;</div> 
<div id="middle"> 

    <h1>Site under construction</h1> 
    <p>Hello, this Web Site is not done yet, sorry.... </p> 

</div> 
<div id="bottom">&nbsp;</div> 

    </div> 

CSS

#top { 
    background-position: center bottom; 
    background: url('Images/RoundRect/top.png') no-repeat center 
bottom; 
    height : 12px; 
    padding : 0; 
    margin: 10px auto 0 auto; 
    width: 910px; 
} 

#middle { 
    background-position: left top; 
    padding: 0; 
    margin: 0 auto 0 auto; 
    width: 910px; 
    height: 5em; 
    background-repeat: repeat-y; 
    background-image: url('Images/RoundRect/middle.png'); 
} 

#bottom { 
    background-position: center top; 
    background: url('Images/RoundRect/bottom.png') no-repeat center 
top; 
    height : 12px; 
    padding : 0; 
    margin: 0 auto 10px auto; 
    width: 910px; 
} 
+1

我没有看到问题(铬),你能澄清? – 2010-01-05 19:22:12

+0

在Safari中看起来不错...也许IE的问题? ;) – 2010-01-05 19:23:07

+0

和Jan和Felix一样。什么浏览器?编辑:在你上传后仍然看起来很好在Chrome ... – 2010-01-05 19:23:50

回答

4

这是因为h1元素。它在顶部创建了一个保证金。添加到您的CSS:

h1 {margin-top: 0px} 

如果您使用的是Firefox,请安装Firebug。它是调试HTML代码的好工具,同时也突出了元素的填充和边距区域。

+0

谢谢!它像一个魅力,现在我明白什么保证金属性呢! – jmasterx 2010-01-05 19:42:50