2011-09-07 124 views
0

所以我想要使用多个使用webkit边框的div标签,但由于某些原因,只有名为“Wrapper”的标签才会呈现。这是我的代码Div标签将无法正确呈现

.wrapper { 
margin: 20px auto 20px auto; 
width: 800px; 
background: url('images/background_1.png'); 
padding: 40px; 
border: 1px solid #fff; 
font: 10px "Visitor", Arial, Verdana, sans-serif; 
border-radius: 10px; 
-moz-border-radius: 10px; 
-webkit-border-radius: 10px; 
box-shadow: 0 0 10px #999; 
-webkit-box-shadow: 0 0 10px #999; 

这里是下面的另一标签的另一个示例:

.body { 
margin: 20px auto 20px auto; 
width: 800px; 
background: #fff; 
padding: 0px; 
border: 1px solid #fff; 
font: 10px "Visitor", Arial, Verdana, sans-serif; 
border-radius: 10px; 
-moz-border-radius: 10px; 
-webkit-border-radius: 10px; 
box-shadow: 0 0 2px #999; 
-webkit-box-shadow: 0 0 3px #999; 

将大大apprec

+0

它是什么,不渲染,股利或边界?你可以发布一些HTML吗? – nnnnnn

回答

0

这个工作对我来说:

<style type="text/css"> 
    .wrapper { 
    margin: 20px auto 20px auto; 
    width: 800px; 
    background: url('images/background_1.png'); 
    padding: 40px; 
    border: 1px solid #fff; 
    font: 10px "Visitor", Arial, Verdana, sans-serif; 
    border-radius: 10px; 
    -moz-border-radius: 10px; 
    -webkit-border-radius: 10px; 
    box-shadow: 0 0 10px #999; 
    -webkit-box-shadow: 0 0 10px #999; 
    } 

    .body { 
    margin: 20px auto 20px auto; 
    width: 800px; 
    background: #fff; 
    padding: 20px; 
    border: 1px solid #fff; 
    font: 10px "Visitor", Arial, Verdana, sans-serif; 
    border-radius: 10px; 
    -moz-border-radius: 10px; 
    -webkit-border-radius: 20px; 
    box-shadow: 0 0 2px #999; 
    -webkit-box-shadow: 0 0 3px #999;} 
    </style> 
    </head> 

    <body> 
    <div class="wrapper"></div> 

    <span class="body">afasfdasdf</span> 
+0

这是否有帮助,或者你已经找到了另一种方式? – checkenginelight

+0

这个修好了,谢谢。对不起,我之前没有提到过,我已经预先从头开始构建一个全功能的论坛 – Semirix

0

我不熟悉的webkit,但{ padding: 0px }可能是罪魁祸首。 ..?

+0

不是这样。我只是试过 – Semirix

0

尝试将border-radius声明放在您的-webkit-border-radius声明下。 (这是为了兼容性的原因更好反正)

.wrapper { 
    margin: 20px auto 20px auto; 
    width: 800px; 
    background: url('images/background_1.png'); 
    padding: 40px; 
    border: 1px solid #fff; 
    font: 10px "Visitor", Arial, Verdana, sans-serif; 
    -moz-border-radius: 10px; 
    -webkit-border-radius: 10px; 
    border-radius: 10px; 
    -webkit-box-shadow: 0 0 10px #999; 
    box-shadow: 0 0 10px #999; 
} 

.body { 
    margin: 20px auto 20px auto; 
    width: 800px; 
    background: #fff; 
    padding: 0px; 
    border: 1px solid #fff; 
    font: 10px "Visitor", Arial, Verdana, sans-serif; 
    -moz-border-radius: 10px; 
    -webkit-border-radius: 10px; 
    border-radius: 10px; 
    -webkit-box-shadow: 0 0 3px #999; 
    box-shadow: 0 0 2px #999; 
}