从打印页面中删除href而不更改样式

时间:2015-11-11 12:09:17

标签: html css

我遇到的问题是,当我尝试打印页面时,每个链接都会在其后面的()之间获取URL。我在这里找到multiple questions,解决方案有效。不过,我还有另外一个问题:添加解决方案后,print.css中的样式似乎被忽略了。

我的CSS

.header-breadcrumb {
    margin-top: 0 !important;
}

.nonPrint, hr, .shows-more, #videoGallery{
    display: none;
}

.single-event .container .col-md-9 {
    width: 70%;
    float: left;
}

.single-event .container .col-md-3 {
    width: 30%;
    float: left;
}

.single-calendar .table-responsive table tbody tr td {
    padding: 2px 5px;
}

.single-description {
    font-size: 10pt !important;
}

h1 {
    font-size: 12pt !important;
}

.printLogo {
    display: block !important;
    width: 200px;
    padding-left: 10px;
}

但是当我添加

a:after {  
      display: none;
      content: "";    
}

字体大小被忽略并跳回原始值(或者看起来如此)。我该如何解决这个问题?

在左侧,您会看到文件应该如下所示(包括右侧边栏中的链接,必须删除),在右侧,您会看到删除了href的文件,但是print.css中的所有新样式似乎都被忽略了。

enter image description here

1 个答案:

答案 0 :(得分:0)

无视我之前所说的话。造型的差异来自以下几点:

由于这个CSS,侧边栏必须填满30%:

.single-event .container .col-md-3 {
    width: 30%;
    float: left;
}

但由于它输出的网址在第一个-之前无法被破坏,因此宽度为30%意味着调整字体大小(Chrome会自动执行此操作)。隐藏URL使我可以实际应用我试图通过CSS应用的字体大小,使得所有内容都比原始文件更大,它实际上是DIDN' T听CSS。

捂脸

这对其他2个人来说可能会有用,所以我会在这里留下这个问题。

相关问题