html - My CSS is not working with boostrap 3 -
i'm starting build webpage using bootstrap 3 (latest version) , reason can't seem add background image.
the coding correct, files in proper folders, etc.
finally decided create webpage exact coding difference css stylesheet not in css folder. refresh , background image appears. when move css file css folder, image gone.
what happening? name of file correct, have added correct path , added other styling besides background image , seem working whether or not css file in or out of folder.
html css file in css folder
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>home</title> <!--bootstrap css --> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <!--custom css --> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> </html>
html css file not in css folder
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>home</title> <!--bootstrap css --> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <!--custom css --> <link rel="stylesheet" type="text/css" href="style.css"> </head> </html>
css:
body { background: url(background.jpg) no-repeat center center; } .container { color: black; font-weight: bold; font-size: 2em; }
if move css file css folder image url in css file should changed too. if css file in css folder , image in root directory image url should background: url(../background.jpg) means go 1 folder , search image.