简体   繁体   English

Bootstrap 4 beta 3是否缺少某些长度单位或我做错了什么?

[英]Is Bootstrap 4 beta 3 missing some length units or did I do something wrong?

I have bootstrap 4 beta 3 installed in a Laravel 5.4 application by changing the package.json to use "bootstrap": "^4.0.0-beta", in place of the entry for loading v3 of bootstrap. 我通过将package.json更改为使用“ bootstrap”:“ ^ 4.0.0-beta”来代替用于加载Bootstrap v3的条目,从而在Laravel 5.4应用程序中安装了bootstrap 4 beta 3。 I also modified the app.scss file and other locations to be sure to reference the bootstrap v4 files with respect to both css and js. 我还修改了app.scss文件和其他位置,以确保相对于css和js都引用bootstrap v4文件。

I am having an issue with in my header with an element that has the navbar-brand class applied to it with respect to it being the proper size. 我的标头中存在一个元素,该元素具有适用于其大小的navbar-brand类的元素。 Upon inspecting that element I found that "font-size: 2;" 检查该元素后,我发现“ font-size:2;” was there and struck out as being invalid. 在那里,被剔除为无效。 Clicking the link to the css file I see this bit of css that clearly is missing the length not on the font-size value. 单击指向css文件的链接,我看到这部分css显然缺少不在font-size值上的长度。

 .navbar-brand { display: inline-block; padding-top: 0.18rem; padding-bottom: 0.18rem; margin-right: 1rem; font-size: 2; line-height: inherit; white-space: nowrap; } 

So, is there something I missed, or is this just a case where this bets 3 is not ready yet? 那么,有没有我错过的事情,还是这只是下注3尚未准备就绪的情况?

In Bootstrap 4 beta 3 the default style of .navbar-brand is as follows: 在Bootstrap 4 beta 3中, .navbar-brand默认样式如下:

.navbar-brand {
    display: inline-block;
    padding-top: $navbar-brand-padding-y;
    padding-bottom: $navbar-brand-padding-y;
    margin-right: $navbar-padding-x;
    font-size: $navbar-brand-font-size;
    line-height: inherit;
    white-space: nowrap;

    /* @include hover-focus */
}

The value of $navbar-brand-font-size is defined in the _variables.scss file as: $navbar-brand-font-size值在_variables.scss文件中定义为:

$navbar-brand-font-size:      $font-size-lg !default;

Where $font-size-lg above is defined in the same file as: 上面的$font-size-lg与以下文件定义在同一文件中:

$font-size-lg:                ($font-size-base * 1.25) !default;

Finally, the default value of $font-size-base is set to 1rem with that: 最后,将$font-size-base的默认值设置为1rem

$font-size-base:              1rem !default;

All of that compiles to font-size: 1.25rem; 所有这些都编译为font-size: 1.25rem; by default , and this is the value that can be observed in the bootstrap.css file available from the official Bootstrap cdn. 默认情况下 ,这是可从官​​方Bootstrap CDN获得的bootstrap.css文件中观察到的值。

So, I guess that this value gets overwritten somewhere in your code. 因此,我想这个值会在您的代码中的某个地方被覆盖。

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

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