【问题标题】:Can't remove line at top of html table无法删除 html 表格顶部的行
【发布时间】:2017-07-04 00:39:13
【问题描述】:

我正在构建一个在主页中间包含一个表格的网站,但我似乎无法让一行(看起来像 <hr> 行)从它的顶部消失。这是页面http://marccary.com/test 的链接,这是我用于表格的代码:

<table cellspacing="0" cellpadding="0" border="none">
  <colgroup border="none">
    <col span="1" width="400" >
    <col span="1" width="400" >
  </colgroup>
  <tr>
    <td height="225" width="600"><p align="center">&nbsp;
&nbsp;
&nbsp;
<iframe width="400" height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F84936057%3Fsecret_token%3Ds-4zQJw&show_artwork=true&secret_url=true"></iframe><br><span style="font-size:20px;"><a href="https://soundcloud.com/marccary" style="color:#white;">Marc Cary on Soundcloud>></a></span></p></td>
    <td height="225" width="600"><p align="center">&nbsp;
<iframe width="400" height="225" src="http://www.youtube.com/embed/j9GhIaaEC6c" frameborder="0" allowfullscreen></iframe>
<span style="font-size:20px;"><a href="http://www.youtube.com/marccary" style="color:#white;">Marc Cary's YouTube channel>></a></savaipan></p></td></tr></table>

我已经进入了我的 CSS 并试图确保表格上没有边框。我已将以下代码放入我的 CSS 样式表中:

table {
    border-collapse: separate;
    border-spacing: 0;
    border: none !important;
    border-top: none;
    border-bottom: none;
}
caption,
th {
    border-bottom: none;
    border: none;
    border-top: none;
}
td {
    font-weight: normal;
    text-align: left;
    border-top: none;
    border: none;
    border-bottom: none;
}
tr {
    border: none;
    border-bottom: none;
    border-top: none;
}

仍然没有运气。有人有建议吗?

【问题讨论】:

  • border="none"更改为border="0"

标签: html-table border borderless


【解决方案1】:

你有一个 CSS 设置:

.entry-content td, .comment-content td {
   border-top: 1px solid #EDEDED;
}

这就是你看到的边界。

这个 CSS

border-top: none;
border: none;
border-bottom: none;

可以简写为

border: none;

【讨论】:

    【解决方案2】:

    将以下内容添加到您的 CSS:

    hr {
        height: 0px !important;
    }
    

    您似乎正在使用 CMS 软件来开发您的网站,而您使用的模板实际上是在 &lt;hr&gt; 处放置

    <div id="page" ...>
        <header id="masthead" ...>
            <hgroup ...>
            <nav id="site-navigation" ...>
            <hr>
        </header>
        <div id="main" ...>
        <footer ...>
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-29
      • 1970-01-01
      相关资源
      最近更新 更多