Skip to content Skip to sidebar Skip to footer

Background From Css Not Working In Base.html

The following base.html code is not implementing the gradient background from the css file that is in the same folder. base.html:

Solution 1:

If this is not working, the problem is going to be the fact that you are referring to a different directory than you are wanting for the style.css folder. If it's in the same folder, please change the href in the link to href="style.css".

This is assuming you have one folder with the base.html and in the SAME folder, there is also the style.css stylesheet .

If it's based on the root directory, you would use /style.css , or on the folder before, ../foldername/style.css. For more, read here.

Solution 2:

text="text/css" should read type="text/css"

Solution 3:

Put the css codes inside the body tag or you can do it like this

body {
    background: linear-gradient(to bottom, #faaca8, #ddd6f3);
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
<!doctype html><htmllang="en"><head><linkrel="stylesheet"type="text/css"href="style.css"></head><body><h1>hi</h1></body></html>

Post a Comment for "Background From Css Not Working In Base.html"