javascript - Border spacing not working - Stack Overflow

So some reason I cannot get my border spacing to work. No matter what size I set it to nothing happens.

So some reason I cannot get my border spacing to work. No matter what size I set it to nothing happens. I'm only using the border for a top line.

My CSS

p {
    border-spacing: 5000px;
    text-align: right;
    color: silver;
    font-size: 70%;
    border-style: solid;
    border-top: solid silver;
    border-width: thin;
    border-bottom: none;
    border-right: none;
    border-left: none;
}

MY HTML

<p>COPYRIGHT © ERNST EVERYTHING INC. ALL RIGHTS RESERVED</p>

So some reason I cannot get my border spacing to work. No matter what size I set it to nothing happens. I'm only using the border for a top line.

My CSS

p {
    border-spacing: 5000px;
    text-align: right;
    color: silver;
    font-size: 70%;
    border-style: solid;
    border-top: solid silver;
    border-width: thin;
    border-bottom: none;
    border-right: none;
    border-left: none;
}

MY HTML

<p>COPYRIGHT © ERNST EVERYTHING INC. ALL RIGHTS RESERVED</p>
Share Improve this question edited Nov 5, 2012 at 18:34 j08691 208k32 gold badges269 silver badges280 bronze badges asked Nov 5, 2012 at 18:32 user1707694user1707694 131 silver badge5 bronze badges 0
Add a ment  | 

4 Answers 4

Reset to default 4

border-spacing only applies to tables. Try using this for your CSS:

p {
    text-align: right;
    color: silver;
    font-size: 70%;
    border-top: thin solid silver;
    padding-top: 5000px;
}

border-spacing is only available for tables, not paragraphs. use padding instead.

p {
 text-align: right;
 color: #C0C0C0;
 font-size: 70%;
 border-top: 1px solid #C0C0C0;
 padding-top: 5000px;
}

border-spacing is a property of tables, not block objects like you're using.

Because it's style for <table> tag. Try this:

<style>
   table {
    border: 4px double #333; 
    border-collapse: separate; 
    width: 100%;
    border-spacing: 7px 11px;
   }
   td {
    padding: 5px; 
    border: 1px solid #a52a2a;
   }
  </style>


 <table>
   <tr>
    <td>1</td><td>2</td>
   </tr>
   <tr>
    <td>3</td><td>4</td>
   </tr>
  </table>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745225664a4617449.html

相关推荐

  • javascript - Border spacing not working - Stack Overflow

    So some reason I cannot get my border spacing to work. No matter what size I set it to nothing happens.

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信