Why the href attributes of a tags are printed to screen? [duplicate]

喜欢而已 提交于 2019-12-31 06:54:09

问题


Possible Duplicate:
Hyperlinks showing URL with Blueprint

DOM:

<div id="menu">
    <ul>
        <a href="#">Home</a>
        <a href="/contacts">Contact List</a>
        <a href="/album">Event Album</a>
    </ul>
</div>

Looks weird, why the href are printed?

    /* Menu */
#menu{
 width:400px;
 height:50px;
 margin:10px auto;
 border:solid 1px #313131;
 background:#ffffff;
 overflow:hidden;
}
/*------ MENU ------*/

    #menu ul{
     list-style:none;
    }

    #menu ul a{
     text-decoration:none;

    }

    #menu ul a:hover{
     color:#7878ff;

    }

回答1:


It looks like you may be grabbing the print.css for the screen. Make sure you have your media types set properly.




回答2:


Make sure the media attribute of your link item is set to "print"

<link rel="stylesheet" href="App_Themes/Default/print.css" type="text/css" media="print" />

The CSS that is responsible for this looks something like:

a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}


来源:https://stackoverflow.com/questions/4834517/why-the-href-attributes-of-a-tags-are-printed-to-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!