javascript - 在移动设备或特定分辨率下添加 <br> 标签

标签 javascript jquery html css

我想为 320 像素 - 480 像素的移动 View 分辨率添加 br 标签。我试过 margin top , bottom 但没有用。所以请帮助我。

我想在这两个 anchor 标记之间添加 br 标记。下面两个这样的标签。

<a class="ww" href="counseller.html">Career Counsellor</a> 
<a class="xx" href="mentors.html"> Career Mentor</a>

最佳答案

你可以使用媒体查询

类(class)mobile适用于 <br /> .当 width浏览器小于 320px,将应用媒体查询中的类并显示元素。

.mobile {
  display: none;
}
@media (max-width: 320px) {
  .mobile {
    display: block;
    /* Add other properties here */
  }
}
<a class="ww" href="counseller.html">Career Counsellor</a>
<br class="mobile" />
<a class="xx" href="mentors.html"> Career Mentor</a>

关于javascript - 在移动设备或特定分辨率下添加 <br> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32901604/

相关文章:

html - 我使用的数据类型有问题吗? (const char *的参数与LPCTSTR类型的参数不兼容)

javascript - ReactJs 调色板抽屉

javascript - 为什么纯字符串被认为是无错误的?

javascript - BackboneJS 与 Codeigniter

javascript - jQuery 获取调用脚本标签的引用

javascript - jQuery 表格排序器 : How to disable sorting on a column by using a class instead of "inline JSON"?

javascript - 如何使用 Angular JS 将透明 HTML 表单放在后台滑动图像的顶部

javascript - 函数给出错误 "div id"未定义。

html - 居中 UL 导航栏

javascript - SVG 不显示通过 d3 和 jquery 添加的元素