#DAY 6 and 7- Coding Journey
DAY 6 - Started to build a Netflix clone in VS code.
Errors were faced while working on that project.
If the image file path works when written directly in the HTML file but not in the CSS file, it could be due to the way the paths are interpreted in different contexts.
When you write the image file path directly in the HTML file, the path is relative to the location of the HTML file itself. However, when you write the image file path in the CSS file, the path becomes relative to the location of the CSS file.
To resolve this issue, you need to adjust the image file path in your CSS file to correctly point to the location of the image file. There are a few ways to do this:
Using an absolute path: Instead of using a relative path in the CSS file, use an absolute path that starts from the root of your website. For example:
.header { width: 100%; height: 100vh; background-image: url(/path/to/images/website_medium.jpg); }
Using the
url()
function with a relative path: You can also use theurl()
function in your CSS file with a relative path to the image file from the CSS file's location. If theimages
folder is at the same level as your CSS file, you can use:.header { width: 100%; height: 100vh; background-image: url(images/website_medium.jpg); }
Using
../
to traverse directories: If theimages
folder is one level above your CSS file, you can use../
to navigate up one level and then access theimages
folder:.header { width: 100%; height: 100vh; background-image: url(../images/website_medium.jpg); }
Day 7 - Solved some Linked List problems on LeetCode for practice. Moving on to the array problems, solve some of the LeetCode problem. Finally, learn how to push files from Visual Studio Code (VSCode) to GitHub using the terminal.
Subscribe to my newsletter
Read articles from Mownika directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Mownika
Mownika
Passionate learner dedicated to acquiring new knowledge and sharing insights to inspire others on their own learning journeys. Join me in exploring diverse topics and fostering a community of knowledge seekers.