简体   繁体   中英

Having trouble linking css to bootstrap

I am rather new to web dev, and am having trouble determining what is wrong with my code. I'm trying to customise bootstrap with my own css, yet it doesnt seem to be linking correctly? I tried changing something as simple as the background-color to the body which didn't work. Ive attached an image of my project below

这里

Am I linking it incorrectly? Help would be much appreciated.

Edit: Image of CSS 在此处输入图片说明

Edit 2:

Apparently I forgot to add "@import UTF-8;" to the CSS sheet, which seems to have fixed the issue. Thanks everyone.

Maybe the problem isn't the file linking. If bootstrap is loading on your project, that isn't the problem, but relative path isn't recommended. Instead, try to use absolute url path.

Maybe the problem is the css rule you are using. if your rule can't ovveride the bootstrap rule, it will not work. Example

A.css

.container > .item{
    background: red;
}

B.css

.item{
    background: blue;
}

example http://codepen.io/maxjf1/pen/qrNNpE

post the css and the html you are having problem.

Try to place your custom.css before bootstrap.css. Cutrently, in case of having some common classes, the classes of bootstrap are considered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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