html - 移动屏幕时如何将两个图像放在彼此相邻的导航栏中

标签 html css twitter-bootstrap navbar

我需要在导航栏中放置两个 png-s,并且当在较小屏幕上的汉堡菜单中时,我需要它们彼此相邻。有什么建议吗? 到目前为止,这是我的代码:

<li class="nav-item" >
    <a id="insta" href="#" class="nav-link"><img width="35" height="35" src="insta.png" alt=""></a>
        </li>
    <li class="nav-item" >
      <a id="insta" href="#" class="nav-link"><img width="35" height="35" src="insta.png" alt=""></a>    
      </li>

如何实现?

最佳答案

如果您使用的是 Bootstrap 4 将此媒体查询用于移动设备

@media (max-width: 576px) { 
.nav-item {
    display: inline-block;
  }

}

如果您使用的是 Bootstrap 3 将此媒体查询用于移动设备

@media (max-width: 768px) { 
.nav-item {
    display: inline-block;
  }

}

关于html - 移动屏幕时如何将两个图像放在彼此相邻的导航栏中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50515099/

相关文章:

事件幻灯片变大的 Javascript 或 jQuery slider

jquery - 从 json 数据库传递 jquery css

javascript - 如何使用 Bootstrap 使我的网站具有响应性?

javascript - 在多列中拆分链接

iphone - Webview 去除 HTML 实体前后的所有空格

html - CSS 关键帧动画延迟

css - 如何使用 xforms 显示表格 :repeat

jquery - 有人能告诉我将需要开始显示 :none? 的图像居中的技巧吗

twitter-bootstrap - float div 旁边的字段集在 chrome/IE 中溢出到右侧,在 FF 中中断到下一行

javascript - Bootstrap轮播移动问题