CSS样式不起作用?

Tom*_*lan 0 html css

我已经使用HTML和CSS大约5年了,我完全失去了这个.http://napletonlaw.connectionsquad.com/

在该页面上,该容器中有一个ID为Clarity的div.

我有CSS规则如下:

#clarity {
text-align: center;
width: 320px;
}
Run Code Online (Sandbox Code Playgroud)

它的代码如下:

<div id="clarity">
            <img src="Resources/magnifying-glass.png" />
            <p>You have questions, and we have answers.  We can help break down the situation into easy-to-understand terms and clear advice. Napleton Law is here to help you!</p>
        </div>
Run Code Online (Sandbox Code Playgroud)

由于某种原因,我应用于该DIV的宽度没有采取...在Dreamweaver的预览中它将div缩小到320px,但是在预览时它没有..我不知道为什么清晰度div在我设置时跨越整个页面宽度为320px ......

Jro*_*rod 6

前面的规则中有一个缺少的括号可能是您的问题的原因.

#container {
    width: 960px;
    height: 800px;
    margin: 0px;
    position: relative;
    z-index: 100;
    background-color: #a0a0a0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 1);
    -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 1; <--- Missing bracket
    -moz-box-shadow: 0 0 10px rgba(0,0,0,1);
}
#clarity {
    text-align: center;
    width: 320px;
}
Run Code Online (Sandbox Code Playgroud)