ie7显示每个链接下面的URL

时间:2013-11-29 09:53:59

标签: html css internet-explorer-7 boilerplate

在我正在开发的网页上,我注意到我的导航栏(仅在IE7中)显示了锚文本以及下面的完整和丑陋的URL,我不希望显示此文本,我该如何隐藏它?为什么会这样?

对不起,这是html代码:

<div id="proa1">
    <h1 style="font-size: 2.6em; margin-left: 12%; line-height:1em; color:#7acd31">Proyectos</h1>
    <h2 style="margin-left: 12%">
        <a href="direcciones.html" title="Direcciones de obra realizadas por LMC arquitectura">Direcciones de obra</a>
    </h2>
    <h2 style="margin-left: 12%">
        <a href="gestion-tecnica.html" title="Gestión Técnica realizada por LMC arquitectura">Gestión Técnica</a>
    </h2>
</div>

我刚刚注意到它与boilerplate.css

有关

我可以告诉你它已经解决了。

这是一个用新流体网格Dreamweaver文档编写的HTML文件。此文档链接到boilerplate.css(对我而言未知)

在此文件的末尾有一个用于打印的部分,并且存在这些属性。在评论这一行后,可以在IE7的模拟器中看到正常

@media print {
 * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* La impresión en negro es más rápida: h5bp.com/s */
/*  a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }  /* No mostrar para imágenes ni para código javascript/vínculos internos */
 pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* h5bp.com/t */
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}

1 个答案:

答案 0 :(得分:0)

你可以改变href attr并使用javascript ...

获取链接
<script>
    $("a").each(function() {
        var $this = $(this);
        var href = $this.attr("href");
        if (typeof href != 'undefined' && href) {
            $this.attr("href", "something else..");
            $this.data("alt-href", href);
        }
    });
    $("a").click(function(e) {
        var $this = $(this);
        var alt = $this.data("alt-href");
        if (typeof alt != 'undefined' && alt) {
            window.location = alt;
            e.preventDefault();
        }
    })
</script>
然而,为什么有人会这样做呢?