我有一个要求,需要使用浏览器的打印选项打印网页(实际上是使用 struts 1.3 创建的 jsp 页面)
我有一个要求,我需要使用浏览器的打印选项打印一个网页(实际上是使用 struts 1.3 创建的 jsp 页面),以便该网页上的按钮在打印或 pdf 中看起来应该稍微暗一些(当我们使用另存为pdf)。
我在 head 标签内尝试了以下代码:
<style>
@media print {
.light {color: #000 !important; }
}
</style>
我将按钮放在 div 内,并尝试在该 div 上应用 .light 类,以便仅在打印或将其另存为 pdf 期间按钮应该可见更暗。
按钮代码如下(这里使用struts bean标签):
<div class="light">
<bean:message key="button.internet.request.update" />
</div>
<% } %>
</html:submit>
<% } %>
所以我添加了行号。 1 和 3 只是将按钮代码放入 div 中并应用该 .light 类。但这没有用。 帮助我在 bean 标签中应用 css 代码,以便按钮在打印页面上打印得更暗,或者在 pdf 中显示得更暗。 我已附上正确按钮和受干扰按钮的图像。这里正确的意思是在应用我的代码之前,而不安的意思是在应用我的代码之后不起作用。
I have one requirement in which I need to print a web page(actually a jsp page created using struts 1.3 ) using browser's print option in such a way that buttons which are there on that webpage should look little darker in print or in pdf(when we use save as pdf).
I had tried below code inside head tag:
<style>
@media print {
.light {color: #000 !important; }
}
</style>
I put the buttons inside a div and tried to apply .light class on that dive so that only during print or saving it as pdf buttons should be visible darker.
buttons code is as below (struts bean tag is used here):
<div class="light">
<bean:message key="button.internet.request.update" />
</div>
<% } %>
</html:submit>
<% } %>
so I added line no. 1 and 3 just for putting the button code inside a div and applied that .light class. But it didn't work.
Help me appling the css code in bean tag so that button gets printed darker on print page or visible darker in pdf.
Images for proper button and disturbed button I have attached. Proper here means before applying my code and disturbed one is for after applying my code which didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论