Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在boostrap 3的小屏幕上改变课堂风格?_Css_Html_Twitter Bootstrap_Media Queries - Fatal编程技术网

Css 在boostrap 3的小屏幕上改变课堂风格?

Css 在boostrap 3的小屏幕上改变课堂风格?,css,html,twitter-bootstrap,media-queries,Css,Html,Twitter Bootstrap,Media Queries,我正在尝试使用\boostrap 3中名为.text center的类? 但我只想在较小的屏幕上将其添加到容器元素中。 试过这样的东西吗 列sm文本中心列xs文本中心 但是不起作用,可以这么简单吗 这是不起作用的代码 <div class="col-md-6 col-sm-text-center col-xs-text-center"> <h2 class="color-brand">Lorem Ipsum</h2>

我正在尝试使用\boostrap 3中名为.text center的类? 但我只想在较小的屏幕上将其添加到容器元素中。 试过这样的东西吗

列sm文本中心列xs文本中心

但是不起作用,可以这么简单吗

这是不起作用的代码

 <div class="col-md-6 col-sm-text-center col-xs-text-center">
          <h2 class="color-brand">Lorem Ipsum</h2>
          <p class="color-grey">Lorem ispums dolor sit</p>
        </div>

乱数假文

Lorem ispums dolor-sit


这样不行。bootstrap 3中的Css前缀(.col xs-,.col sm-等)仅用于定义不同屏幕大小的列大小,而对齐类则是用于对齐块内文本的类。 您可能只需要使用css3媒体查询即可:

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) { 
  .my-fancy-block {
    text-align:center;
  }
}

是的,我知道,这将是非常好的,我们可以使用的东西,我建议比这么少的媒体查询的框架