我有下面的 JSP 代码,它打印在页面上像
USE BY:APR/04/2017
现在我想把它打印成
Use By:APR/04/2017
虽然 label.global.useBy 的值是“Use By”,但由于我在 CSS 中定义的样式,它被大写了。我这样做是为了以所有大写字母呈现月份。否则它被打印为
Use By : Apr/04/2017
您能否建议我如何保持“Use By”的原样,并让月份大写,如:
Use By: APR/04/2017
<td class="contentArea"><bean:message key="label.global.useBy"/>: <bean:write name="details"property="expirationDate" formatKey="format.date.certificate" /></td>
关联的 CSS
.contentArea {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #000000;
text-transform: uppercase;
}
最佳答案
感谢@Rahul Kapuriya, 我像这样在 TD 中使用 SPAN 标签,
<td class="contentArea"><bean:message key="label.global.useBy"/>: <span style="font-weight:bold; text-transform: uppercase;"><bean:write name="details"
property="expirationDate" formatKey="format.date.certificate" /><span></td>
谢谢!
关于html - 如何格式化日期以大写字母打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38334141/