简体   繁体   English

twitter-bootstrap徽标位置(台式机+移动设备)不同的位置

[英]twitter-bootstrap logo position (desktop + mobile) different position

thank you for your support. 谢谢您的支持。 I have created one litte bootstrap page. 我创建了一个小引导页面。 I have only two little problems. 我只有两个小问题。 The logo position on the desktop browser is different to the position on the mobile device (iphone). 桌面浏览器上的徽标位置不同于移动设备(iphone)上的徽标位置。

i found out that if you change the css code "bootstrap.min.css" from the container-fluid - padding-left:15px; 我发现,如果您从容器流体中更改CSS代码“ bootstrap.min.css”-padding-left:15px; to padding-left:0px; 到padding-left:0px; the logo will be at the correct position on the desktop browser but on the wrong possition on the mobile device. 徽标将在桌面浏览器上的正确位置,但在移动设备上的位置错误。

sample image 样本图像

do you have any ideas to solve this problem? 您有解决这个问题的想法吗?

The reason why you are experiencing this is because twitter bootstrap utilizes media queries . 之所以遇到这种情况,是因为twitter引导程序利用了媒体查询 A media query essentially allows for a css class or id to have differing stylings for different screen widths. 媒体查询本质上允许css类或id对于不同的屏幕宽度具有不同的样式。

To fix this you could go in and alter every media query in the minified code to fit your requirements. 要解决此问题,您可以进入并更改最小化代码中的每个媒体查询,以满足您的要求。 A better solution however, is to write your own css in a separate file that over rides the bootstrap . 但是,更好的解决方案是将自己的css写入一个单独的文件中,该文件会超出bootstrap的范围

Example

So here is a div with container fluid 所以这是一个容器液体的div

<div class="container-fluid example">
 // your div content
</div>

Here is your css that will override the padding left. 这是您的CSS,它将覆盖左侧的填充。

.example {
  padding-left: 0px;
}

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

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