【问题标题】:why border-width property not styling my html? [duplicate]为什么border-width 属性不设置我的html 样式? [复制]
【发布时间】:2015-02-17 22:38:32
【问题描述】:

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

下面是我的代码:

CSS:

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

【问题讨论】:

    标签: html css stylesheet


    【解决方案1】:

    尝试使用适当的<style></style> 属性嵌入头部。

    注意:单独使用“border-width”属性不起作用。首先使用“border-style”属性设置边框。


    Reference Here

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-08
      • 2016-11-19
      • 2019-09-14
      • 2022-01-15
      • 1970-01-01
      • 1970-01-01
      • 2021-11-24
      相关资源
      最近更新 更多