0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

印刷時に表示されるURLを消す方法

Last updated at Posted at 2020-02-18

Bootstrapが使われたwordpressでテーマを作成する際、アーカイブページをプリントアウトすると、意図しないURLが表示されていた。

解決方法

解決方法は以下のcssを組み込めはオッケー。

@media print {
 a[href]:after {
 content: "" !important;
 }
}

また、abbrタグのtitle属性を非表示にしたいときは、以下を組み込むと良い。

@media print {
 abbr[title]:after {
 content: "" !important;
 }
}

原因

bootstrap.cssには以下のcssが組み込まれていたことが原因であった。
そのため、打ち消すcssを作るか以下のコードを削除すれば良いことになる

bootstrap.css
a[href]:after {
    content: " (" attr(href) ")";
  }
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?