为什么border-width属性没有样式化我的HTML?

时间:2014-12-19 01:24:00

标签: html css css3 stylesheet

为什么边框宽度未应用css不起作用?

以下是我的代码:

CSS:

  {
   border-style:solid;
   border-width:10px;
  }

1 个答案:

答案 0 :(得分:1)

尝试在头部之间嵌入适当的<style></style>属性。

注意:&#34; border-width&#34;如果单独使用,财产不起作用。使用&#34; border-style&#34;首先设置边框的属性。


Reference Here

&#13;
&#13;
<!DOCTYPE html>
<html>
<head>
<style>
p.one {
    border-style: solid;
    border-width: 5px;
}
</style>
</head>
<body>

<p class="one">Some text.</p>

<p><b>Note:</b> The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.</p>

</body>
</html>
&#13;
&#13;
&#13;