简体   繁体   English

如何在离线使用时更改 Bootstrap 中任何类的样式(CDN)..?

[英]How to change style of any class in Bootstrap while using it offline(CDN)..?

在通过 CDN 使用 bootstarp 时更改预定义类样式的可能方法是什么,例如,如果我使用导航,而不是如何更改在导航类中定义的样式?

on your page write the style you want inside在您的页面上写下您想要的样式

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<style>
    .navbar 
    {

    }
</style>

tags after the CDN link. CDN 链接后的标签。 That should do it.那应该这样做。 If you want your style to be applied no matter where you put it on the page (no matter the order of it) you can use !important which will have the style always be applied no matter where it appears in the CSS document or on your HTML page.如果你希望你的样式无论你把它放在页面的什么地方(不管它的顺序)都被应用,你可以使用!important它将始终应用该样式,无论它出现在 CSS 文档中还是在你的页面上HTML 页面。

Example to the bootstrap navbar class:引导程序导航栏类的示例:

.navbar {
                 display: block !important;
            }

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

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