First time coding my own website and first time uploading it. First time for everything basically. Yes, I have multiple CSS style sheets, some of my pages have different layouts.
My website works perfectly on my local drive, but of course falls apart when I upload it to Host Gator via FileZilla. I ensured that I followed case-sensitivity for my links/directories/images etc.
I believe it's just my DIV background images on the index page that aren't loading properly and then the CSS style sheets aren't being applied to the rest of my website- yet it works for the homepage. I have confirmed the images are accessible when you type their url in directly.
I have no idea why only my one css style sheet works and not the rest, and why my DIV background images aren't loading properly. Any advice is greatly appreciated, I just want my website to go live finally!
Feel free to have a look: www.alanphunt.com and let me know what you think. I've only taken a semester of an introductory web development course so go easy on me!
Most likely the problem is with relative and absolute path usage. Check if you can open the given CSS from the source code of the page. If you cannot it means that your browser can't do it either. If you can, the CSS should be loaded.
This is a problem with connecting your CSS to HTML or paths, for sure. You should double check every path on your code, sometimes I paste things and forget to change the path, look out for that.
As other answers have stated, the problem is the relative paths.
As for your specific question: on the home page, the background images images/alan.jpg
and images/seemennt.jpg
are set in an external stylesheet. Because the path doesn't begin with a forward slash, they'll try to load relative to the location of the stylesheet, in this case the "css" folder. (You can hit F12 in your browser and look at the console to confirm this. It'll also help to diagnose exactly what isn't loading.)
Try changing the paths to something like ../images/alan.jpg
and it should work.
Are you using Google Chrome? If you are, head to:
Here, you will be able to view the outputted HTML that your browser is using to display your website.
After looking through the Source code of your Homepage, I can see the following URL, for your Stylesheet:
css/indexcss.css?v=version2
I selected this URL and it brings up your Stylesheet. I then checked out the source code of your other pages ('Photography', 'Music', 'DJ Life' and 'Reach Out'), and can see that your stylesheets have been incorrectly inputted. You need to perform the following changes:
photography.css
to css/photography.css
musiccss.css
to css/musiccss.css
djcss.css
to css/djcss.css
reachoutcss.css
to css/reachoutcss.css
This should resolve your issue.
Best of luck with your website!
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.