简体   繁体   English

Bootstrap 3在加载时忽略custom.css

[英]Bootstrap 3 Ignores custom.css on load

I have this very strange problem. 我有这个非常奇怪的问题。

I'm trying to code with Bootstrap 3 . 我正在尝试使用Bootstrap 3进行编码。 in the <head> I declare links for CSS to be used. <head>我声明了要使用的CSS的链接。 Although the HTML completely ignores my third link. 尽管HTML完全忽略了我的第三个链接。

<head>
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">        
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap-theme.css" rel="stylesheet">      
    <link href="css/custom.css" rel"stylesheet">
</head>

As you can see, the third link refering to css/custom.css is there correctly. 如您所见,引用css / custom.css的第三个链接正确存在。 But on the website it's being completely ignored. 但是在网站上,它被完全忽略了。

I have tried coding a simple button using 我试图使用编码一个简单的按钮

<button type="button" class="btn btn-primary">Default</button>

And in custom.css I have the .btn class 在custom.css中,我有.btn类

.btn{
border-radius: 0px;
}

So the button's border should be straight not rounded like it is in bootstrap3. 因此,按钮的边框应该是直线的,而不是像bootstrap3那样是圆形的。 Problem is that my custom.css doesn't want to work and it's just completely ignored. 问题是我的custom.css不想工作,只是被完全忽略了。

Can anyone please help me with this? 谁能帮我这个忙吗?

Thank you. 谢谢。

Patryk. 帕特里克。

Add '=' after 'REL'. 在“ REL”之后添加“ =”。

Your code: 您的代码:

 <link href="css/custom.css" rel"stylesheet">

Should be: 应该:

 <link href="css/custom.css" rel="stylesheet">

If custom.css is correctly loaded than bootstrap code has a higher precedence, so you might want to use button.btn.btn-primary{border-radius: 0px;} or .btn.btn-primary{border-radius: 0px!important;} 如果正确加载了custom.css而不是引导程序代码具有更高的优先级,那么您可能要使用button.btn.btn-primary{border-radius: 0px;}.btn.btn-primary{border-radius: 0px!important;}

As @Damian says it, the custom.css file is not loaded at all. 就像@Damian所说的那样,根本不会加载custom.css文件。

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

相关问题 Custom.css 不会覆盖 bootstrap.min.css - Custom.css isnt overwriting bootstrap.min.css 正确格式的custom.css - Correct formatting for custom.css 如何从我的 custom.css 文件中应用 btn btn-primary bootstrap class? - how to apply btn btn-primary bootstrap class from my custom.css file? 使用Custom.css的Wordpress .CSS编辑菜单 - .CSS edit menu with wordpress using Custom.css 通过Custom.css删除移动菜单中的项目 - Delete a item in mobile menu via Custom.css 如何在custom.css中将li。(名称)居中-Dreamweaver - how to centre li.(name) in custom.css - dreamweaver gentelella for django无法识别custom.css上的更改 - gentelella for django doesn't recognize changes on custom.css 从 nbconvert 生成的 html 文件中的 custom.css 在哪里? - Where is custom.css in the generated html file from nbconvert? 使用 custom.css 覆盖 Jupyter markdown 单元格中的 html 蓝色字体颜色 - Override html blue font color in Jupyter markdown cell using custom.css 我的Joomla模板正在使用JS加载我的自定义CSS。 有没有一种方法可以将唯一的版本标签添加到我的自定义CSS中? 即:custom.css?20180101 - My Joomla Template is loading my custom CSS using JS. Is there a way to add the unique version tag to my custom CSS? i.e: custom.css?20180101
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM