简体   繁体   English

不同屏幕尺寸的引导显示

[英]Bootstrap display for different screen size

How set display block only for phone screen and for any other set display-inline using bootstrap 4?如何使用引导程序 4 仅为手机屏幕和任何其他设置显示内联设置显示块?

My code example did not work.我的代码示例不起作用。

 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <div class="d-md-inline d-lg-inline d-sm-inline d-xs-block p-2 bg-primary text-white"> TEST </div>

  • bigger than 768px: inline大于 768px:内联
  • smaller than 768px: block小于 768px:

 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <div class="d-sm-block d-md-inline p-2 bg-primary text-white"> TEST </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM