GVKun编程网logo

css – twitter bootstrap box-sizing破坏了我的布局

19

在本文中,我们将为您详细介绍css–twitterbootstrapbox-sizing破坏了我的布局的相关知识,此外,我们还会提供一些关于Bootstrap-坑-box-sizing、box-siz

在本文中,我们将为您详细介绍css – twitter bootstrap box-sizing破坏了我的布局的相关知识,此外,我们还会提供一些关于Bootstrap-坑-box-sizing、box-sizing Bootstrap、css – Twitter Bootstrap btn-primary Size IE8、ruby-on-rails – rails使用bootstrap-sass而不是twitter-bootstrap-rails生成bootstrap布局的有用信息。

本文目录一览:

css – twitter bootstrap box-sizing破坏了我的布局

css – twitter bootstrap box-sizing破坏了我的布局

当我在我的项目的一半实施bootstrap时,我的布局破碎,修正了一些css修改,我已经评论了这个
/**,*:before,*:after {
  -webkit-Box-sizing: border-Box;
     -moz-Box-sizing: border-Box;
          Box-sizing: border-Box;
}*/

在bootstrap.css中,会影响其核心吗?我只想在我的项目中使用网格系统

解决方法

是的,不要这样做删除框大小:border-Box将破坏您的网格。参见: Why did Bootstrap 3 switch to box-sizing: border-box?

举例说明会发生什么:

<div> 
    <div> 
        <div><p>Content</p></div>
        <div><p>Content</p></div>
    </div>
</div>
<br>
<divhttps://www.jb51.cc/tag/Box/" target="_blank">Box">    
    <div> 
        <div><p>Content</p></div>
        <div><p>Content</p></div>
    </div>
</div>

附:

.nonborderBox *
{
-webkit-Box-sizing: content-Box;
     -moz-Box-sizing: content-Box;
      Box-sizing: content-Box;
}

以上将导致:

通过框尺寸:边框,填充的沟槽结构将不在列的宽度的计算中。

尝试了解Bootstrap的网格和框尺寸:边框,并弄清楚为什么会破坏您的布局。解决这个问题,或考虑不要使用Bootstrap来完成你的项目。

Bootstrap-坑-box-sizing

Bootstrap-坑-box-sizing

总结

以上是小编为你收集整理的Bootstrap-坑-box-sizing全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

box-sizing Bootstrap

box-sizing Bootstrap

https://getbootstrap.com/docs/4.0/getting-started/introduction/#box-sizing

Box-sizing

For more straightforward sizing in CSS,we switch the global Box-sizing value from content-Box to border-Box. This ensures padding does not affect the final computed width of an element,but it can cause problems with some third party software like Google Maps and Google Custom Search Engine.

On the rare occasion you need to override it,use something like the following:

 
.selector-for-some-widget { Box-sizing: content-Box; }

With the above snippet,nested elements—including generated content via ::before and ::after—will all inherit the specified Box-sizing for that .selector-for-some-widget.

Learn more about box model and sizing at CSS Tricks.

css – Twitter Bootstrap btn-primary Size IE8

css – Twitter Bootstrap btn-primary Size IE8

IE8及以下的Twitter Bootstrap有没有人注意到奇怪的行为?我有两个按钮,如下:

<input type="submit"/>
<input type="reset"/>

btn-primary按钮显示的很小,但是btn btn-large的按钮很大,正如预期的那样.

有任何想法吗?

谢谢,
克里斯

编辑:截图:

解决方法

从我的评论

Typically any issues you might find with buttons are due to other
style sheets,are you including anything other than bootstrap css?

你想要做的是在元素上使用CHROME’右键单击’,然后检查,然后查看应用于该元素的样式.

通常情况下,其他事情是继承或引发冲突. IE是一个善变的野兽,我认为我们大多数人在CSS / HTML5时宁愿不这样做;)

ruby-on-rails – rails使用bootstrap-sass而不是twitter-bootstrap-rails生成bootstrap布局

ruby-on-rails – rails使用bootstrap-sass而不是twitter-bootstrap-rails生成bootstrap布局

我不得不选择bootstrap-sass和twitter-bootstrap-rails,我根据网络上的建议选择了第一个.

但是,我看到twitter-bootstrap-rails gem有一些用于应用程序布局的生成器.喜欢,

rails g bootstrap:layout application fixed
rails g bootstrap:themed Posts

我认为这对于启动项目非常有用.但是我没有在bootstrap-sass gem中找到类似的生成器.运行命令:

rails generate

没有像以前那样显示任何生成器.

有没有办法让这些布局使用bootstrap-sass而不是使用twitter-bootstrap-rails?

提前致谢.

解决方法

我正在使用这个宝石,虽然我不知道它的生成器.

我在GitHub上找到了一个你可能会觉得有用的宝石:

https://github.com/decioferreira/bootstrap-generators

或者,您可以简单地定义一个新的custom.css.scss文件,并开始使用整个应用程序的CSS.并且不要忘记将bootstrap导入添加到您的文件中!

今天关于css – twitter bootstrap box-sizing破坏了我的布局的介绍到此结束,谢谢您的阅读,有关Bootstrap-坑-box-sizing、box-sizing Bootstrap、css – Twitter Bootstrap btn-primary Size IE8、ruby-on-rails – rails使用bootstrap-sass而不是twitter-bootstrap-rails生成bootstrap布局等更多相关知识的信息可以在本站进行查询。

本文标签: