我使用触控笔和bootstrap 3,并希望将博客的填充属性设置为不同的屏幕尺寸,因此我写了以下内容:

.blog
    margin-bottom: 20px
    if @screen-sm-min
        margin-bottom: 10px
. 但是,即使我运行了我的应用程序,它也没有改变。我不确定我的语法有什么问题。为什么这不起作力?如何解决此问题?

有帮助吗?

解决方案

您将想要使用 css媒体查询

说:

@media (min-width: 1000px) and (max-width: 1200px) {
  .. add some styles here...
}
.

与说法相同:

if (the minimum width of the screen is 1000px && the maximum width of the screen is 1200px) {
  .. add some styles here .. 
}
.

其他提示

您应该阅读的内容是响应的设计媒体查询。 您可以阅读以下称: http://www.onextrapixel.com/2012/04/23/responsive-web-design-layouts-and-media-queries/

但简单的谷歌搜索响应设计将为您提供许多结果。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top