gpt4 book ai didi

html - CSS 样式不起作用?

转载 作者:太空宇宙 更新时间:2023-11-03 20:19:48 27 4
gpt4 key购买 nike

我已经使用 HTML 和 CSS 工作了大约 5 年,对此我完全不知所措。 http://napletonlaw.connectionsquad.com/

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

我有如下 CSS 规则:

#clarity {
text-align: center;
width: 320px;
}

它的代码如下:

<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>

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

最佳答案

前面的规则中缺少一个括号,这可能是导致您出现问题的原因。

#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;
}
<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>

#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;
}

关于html - CSS 样式不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13035696/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com