边框式不工作div

时间:2014-02-02 16:55:40

标签: html css

我有一个div,其风格如下所示,我想要一个漂亮的边框。 border-radius有效,但边框样式和边框宽度不显示。我不明白为什么会这样。

<html>
<head>
<style>
div.request{
   background-color: #CDCDCD;
   margin-left:auto;
   margin-right:auto;
   display:block;
   width:700px;
   height:2000px;
   text-align:center;
   box-shadow: 10px 10px 15px #000000
   border-style: outset;
   border-width:5px;
   border-color: #FFFFFF;
   border-radius:25px;
   padding:10px;
}
</style>
</head>
<body>
   <div class='request'>
      <p>
      "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt  ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est                 laborum."
      </p>
      <p>

      </p>
   </div>

2 个答案:

答案 0 :(得分:3)

您错过; box-shadow: 10px 10px 15px #000000附近的;。每个CSS规则 - 期望最后一个 - 必须具有结束分号。为防止出错,您应始终添加/** This is always working */ div.request{ margin: 25px; padding:10px /* missing semicolon ignored by browsers */ } /** This is an error */ div.request{ margin: 25px /* Breaking */ padding:10px; }

http://jsfiddle.net/Rnx7m/

{{1}}

答案 1 :(得分:1)

以下行末尾缺少结束;box-shadow: 10px 10px 15px #000000