html - CSS HTML 如何删除表格中的整个单元格链接?

标签 html css hyperlink html-table

我想要一个带有页脚的网页,其中有垂直对齐的链接。 因此,我使用了一个表格,其中我写了我的链接,如“移动”、“帮助”、“条款”……

问题是,当将鼠标指向表格时,链接处于事件状态(即使在空单元格上)。当我将鼠标指向名称“Mobile”、“Help”、“Terms”时,我只想拥有链接 - 而不是当我指向单元格的其余部分或表格上的其他任何地方时。

我在 Stackoverflow 上研究了这个东西,但总是出现相反的问题(人们想要激活单元格链接)。

有人可以帮忙吗?代码如下。

HTML代码

    <div id="footer">
<div class = "box2">
    <h6><a href="/error">Français</h6>
    <h6><a href="/error">English (US)</h6>
    <h6><a href="/error">Español</h6>
    <h6><a href="/error">Português (Brasil)</h6>
    <h6><a href="/error">Deutsch</h6>
    <h6><a href="/error">Italiano</h6>
    <h6><a href="/error">Русский</h6>
</div>

    <div class = "box3">
        <table class="table2">
            <tr>
                <td><h6><a href="/mobile">Mobile</h6></td>
                <td><h6><a href="/help">Help</h6></td>
                <td><h6><a href="/term">Terms and conditions</h6></td>
                <td><h6><a href="/developers">Developers</h6></td>
                <td><h6><a href="/carriers">Carriers</h6></td>
                <td><h6><a href="/other">Other</h6></td>
            </tr>
            <tr>
                <td><h6><a href="/blog">Blog</h6></td>
                <td><h6><a href="/findus">Find us</h6></td>
                <td><h6><a href="/pics">Pics</h6></td>
            </tr>
        </table>

    </div>
        </div>

CSS 代码

#footer {
    height: 110px;
    background: #80B2E6;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#80B2E6), color-stop(100%,#3385D6));
    background: -moz-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -webkit-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -o-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: -ms-linear-gradient(top, #80B2E6 0%, #3385D6 100%);
    background: linear-gradient(top, #80B2E6 0%, #3385D6 100%);
}

.box2
{
    width:800px;
    border-bottom:1px solid lightgrey;
    display:inline-block;
    padding-top:20px;
}

.box3
{
    width:800px;
    padding:0;
}


.table2 {
    width:450px;
    padding:0;
    font-size:11px;
    table-layout: auto;
    float:left;
    border-collapse:collapse;

}


h6 {
    font-weight: normal;
    font-size: 11px;
    max-width: 800px;
    color: white;
    margin:0;
    padding-bottom:3px;
    padding-right:10px;
    /*display:inline-block;*/
    float:left;
}

h6 a:link {
    color:white;
}

.table2 td a {
    color:white;
    display:inline;
}

a:link {
    text-decoration:none;
    color: #54544B;
}

table {
    width:420px;
    /*height: 200px;*/
    padding:10px;
    margin-bottom:10px;
    border-collapse:collapse;
    table-layout: fixed;
}

td
{
    text-align:center;
    position:center;
    padding-top: 3px;
    padding-bottom: 3px;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -o-hyphens: auto;
    hyphens: auto;
    word-wrap: break-word;
}

tr, div {

}

最佳答案

</a> 关闭所有链接标签.例如改变

<td><h6><a href="/mobile">Mobile</h6></td>

<td><h6><a href="/mobile">Mobile</a></h6></td>

以及所有链接的其余部分

关于html - CSS HTML 如何删除表格中的整个单元格链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24323110/

相关文章:

html - 为什么 HTML/CSS 专业开发人员使用 % 宽度

JavaScript - 游戏。匹配随机生成器生成的两个变量的算法

javascript - 表格标签内的 HTML 标题标签的浏览器问题

javascript - 使用Jquery触发链接的方法

html - 添加与导航栏同级的社交图标

javascript - 当元素高度取决于该元素内的文本时,对元素高度进行动画处理

javascript - JavaScript 对象究竟是如何工作的?我可以将函数声明为 JavaScript 对象的字段吗?

html - 删除 h1 和 h2 之间的空格

html - 使用 url 查询字符串跳转到页面部分

css - 删除无序列表中链接之间的间隙