gpt4 book ai didi

html - 使用 css 从打印页面中删除 URL

转载 作者:太空宇宙 更新时间:2023-11-04 09:41:10 24 4
gpt4 key购买 nike

<body>
<div class="print-logo">
<img class="print-logo img-responsive" id="logo" src="http://logo.png" alt="image" /></div>
<div class="print-site_name">Published on <em class="placeholder">website name</em> (<a href="http://localhost">http://localhost</a>)</div>
<p />
<div class="print-breadcrumb"><a href="/">Home</a> Reportedly Prepping </div>
<hr class="print-hr" />
<div class="print-content"><article id="node-ID" class="node node-blog clearfix">
<div class="bd-headline left"> some title </div>
<div class="item-body">
<p dir="ltr"><span id="docs-internal-guid-???">
<img alt="Core" height="366" src="http://image.png" width="645" />
<span> contributor helping report. It’s the latest nightmare.</span><a href="http://url-to-be-removed">some text for the url to be removed(http://url-to-be-removed) then some more text.
</p>
<p> some more text and another url</p>
</div>
...

如何使用 CSS 删除 URL。由于 URL 在正文中,我尝试使用类名和 html 标记:

div.print-content article.node .node-blog .clearfix div.item-body p a { content: "";}   

更新
我要删除的部分是粗体
贡献者帮助报告。这是最近的噩梦。 some text for the url to be removed (http://url-to-be-removed ) 然后是更多文本。

最佳答案

要从打印媒体中删除 URL,请使用:

@media print {
div.print-content article.node .node-blog .clearfix div.item-body p a {
display: none;
}

如果您想要的是让它完全消失(从任何 Angular 来看),只需添加 div.print-content article.node .node-blog .clearfix div.item-body p a { display: none; }

以这种方式添加它会将其从文档 View 中完全删除,从而释放 <a> 占用的所有空间。标签。

关于html - 使用 css 从打印页面中删除 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39905253/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com