简体   繁体   English

如何在我的代码中为几行加载自定义 CSS?

[英]How can I load a custom CSS for a few lines in my code?

I want to use Bootstrap for dropdown content, and it works perfectly fine, however, it than overrides the default CSS I'm using on my website and most of the things are looking awful below that button.我想将 Bootstrap 用于下拉内容,它工作得非常好,但是,它会覆盖我在我的网站上使用的默认 CSS 并且大多数事情在该按钮下方看起来很糟糕。 I have tried to unload the CSS (Bootstrap) after I don't need it with the following code, but it is not working.在不需要使用以下代码之后,我尝试卸载 CSS(引导程序),但它不起作用。

<script type="text/javascript">
  jQuery('link[href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"]').prop('disabled', true);
</script>

Link your default.css file below the bootstrap.css.在 bootstrap.css 下方链接您的 default.css 文件。 default.css style definitions will override bootstrap.css default.css 样式定义将覆盖 bootstrap.css

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="default.css">

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

相关问题 如何将我的自定义 CSS 和 HTML 导入 Wordpress? 以及如何防止更新删除我的代码? - How can I import my custom CSS and HTML into Wordpress? And how do I prevent updates from erasing my code? 如何在 Safari 中加载带有 CSS 的自定义字体? - How can I load a custom font with CSS in Safari? 如何为存在的一个类编写CSS选择代码,而为其他几个不编写代码呢? - How can I code a CSS select for one class being present and even one of a few others not? 如何避免CSS转换(旋转和倾斜原点)向右移动几个像素? - How can I keep my CSS transform (rotate & skew origin) from moving a few pixels to the right? 如何下载html文档的前几行? - How can I download the first few lines of an html document? 如何在 Laravel 代码之前加载 CSS? 使用顺风 - How can i load the CSS before the Laravel code? Using Tailwind 如何更改这两行HTML,以便可以将其放入CSS? - How can I change this 2 lines of HTML so that i can put it into my CSS? 如何阻止自定义CSS覆盖样式? - How can i stop a custom CSS from overwriting my styles? 如何在iPhone 5 Web应用程序上显示我的自定义CSS? - How can I show my custom css on the iPhone 5 web app? 如何将自己的自定义CSS和HTML添加到Prestashop? - How can I add my own custom css and html to Prestashop?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM