css - 如何在移动视图中忽略 br 标签
问题描述
我有一些代码行,我
只需要在桌面视图中使用标签,但在移动视图中忽略它。代码是
<p class="email-message">
<spring:theme code="text.guestuserorder.status.email.confirmation" text="Your order number can be found in your confirmation email"/>
<c:if test="${resendEmailToggle eq 'true'}">
<br><span role="link" tabindex="0" class="resend-confirmation-mail-link mobile-alignment"><spring:theme code="lost.your.confirmation.mail.text" text="Lost your confirmation mail?"/>
<span class="sr-only">This action will open modal</span>
</span>
</c:if>
</p>
解决方案
将此添加到您的 CSS 中:
@media(max-width: 360px) {
.email-message br {
display: none;
}
}
使用一些ID或类将其效果封装在您特别需要的元素中,否则它将摆脱br
移动中的所有标签。如果这是您想要的,只需执行以下操作:
@media(max-width: 360px) {
br {
display: none;
}
}
推荐阅读
- twilio - Twilio TaskRouter 点击调用编排
- symfony - Symfony bundle - 生成配置文件
- r - 从具有未知列数的数据框中将多个参数传递给函数
- excel - 为什么相同的代码结构在某些地方有效,但在其他地方却不能用于着色单元格
- back - 如何使用指向同一页面的后退按钮创建链接?
- typescript - 打字稿中 ID 的扩展类型不接收 ID 属性
- apache - Apache 重写日志
- javascript - SWR 大小,setSize 在 SWRResponse 类型上不存在
? - vue.js - Laravel 和 VueJS 的 ID 动态菜单
- javascript - 如何在 JavaScript 中根据数组值返回对象值