Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

grid.css works offline but not when FTP to domain, HELP!

My problem is that my grid.css file does not work when I FTP it to my domain and view it from the site.

It works just fine when I open the html file on my browser.

I don't believe this to be a link issue, since my page css is located in the same folder and works just fine on and offline. The grid is located in the same folder with the same location, except ending with grid.css (css/grid.css) I've also tried ../css/grid.css

Also, I triple checked spelling and that the file was actually transferred via Cyberduck to the server.

Again, the page I created works perfectly when viewed by the browser offline from the html file. Same browser, html, css but when FTP'd to my domain it does not register my grid.css file.

Thank you in advance for you help!

4 Answers

James Barnett
James Barnett
39,199 Points

Ryan Lockhart -

You need to change the permissions on those CSS files to match your other files.

That's almost always 644 in octal or in other words. set Owner to read write execute & set group & other to read write.

Since you mentioned Cyberduck here's a tutorial on how to do just that: http://webmaster.iu.edu/tools-and-guides/maintenance/chmod-ftp.phtml

Oli Treadwell
Oli Treadwell
3,927 Points

Thanks James, this solved my issue 6 months after the fact tips fedora

Kevin Korte
Kevin Korte
28,149 Points

It is a link issue.

How are your files structure. Is your header file separate of the index files and than included when the page is loaded, or is it more simple where one page is one file?

Are your web pages in the root folder of the web server, or no?

Do you have a link to your broken page so we could look at the source code?

Kevin,

Thanks for the response, a little unsure of what you mean. Still new to coding.

Here's the link in my index.html file: <link rel="stylesheet" href="css/grid.css" text="text/css" media="screen">

Currently its a webpage, not a website so theres only one index file. When logging onto the web server I place all the files into the domain name folder. Example; Domain name folder > css folder / img folder / index.html Inside the css folder is the grid.css file. It shouldn't be a problem with my html since <link rel="stylesheet" href="css/homepage.css" text="text/css" media="screen"> works just fine when styling the page.

Can you clarify on where my grid.css file should be stored in the web server?

Kevin Korte
Kevin Korte
28,149 Points

Hi Ryan,

I reread and saw that your grid and css are sepearte, and the styling is coming through, not the grid. Your link didn't show up, but there are a couple of things that could be happening.

CSS is cascading, meaning the last css file to be linked will override any styles or layout from other CSS files, so be aware of that. It may be that your style css is overriding your grid css and causing the issue. Probably unlikely though.

When you built this website offline, did you use any sort of localhost server software to develop like MAMP, WAMP , XAMPP, etc? Or did you just point your browser to the index file on your harddrive?

I think what possibly could be causing your issue might be the domain name folder in the root directory of your web server. That is unnecessary, as when a browser goes to that web domain, it is going to look for an index file inside of that root folder.

Try linking your index file again. Being able to look at the source code will help us figure out what exactly is going on. I can't quite tell.

As far as structuring your web files, you're new and that is okay. I would suggestion when you feel comfortable to start the "Build a simple PHP" lesson on the site here. Randy does a great job explaining a pretty solid way to organize files, and how to use PHP to generate links to assets like your grid.css file so when you move from your local computer to a web server, you don't have links breaking. It's a pretty easy lesson to go through, but I'd do it after you do the HTML and CSS lessons.

I restructured my code to links normalize.css, grid.css, then style.css and no luck.

No localhost server MAMP was off and I just loaded the index file from my harddrive.

Also, I took out the domain name folder on the web server and my page will not load, getting a 404 Not found error.

I will re-watch the build a simple PHP and try to go from there. My page I am trying to build is located at www.harmonyhollows.com. upon viewing the source code I noticed that you can view my style css file but not my normalize or grid files.

you can tell grid is not working because the container is not displayed. causing the padding to run the entire length of the page and the nav li to be below the padding. (ignore the image, it wont be staying brown. lol)

Kevin Korte
Kevin Korte
28,149 Points

Mmm.. normailize and grid are both throwing a 403 Forbidden error. I'm not exactly sure why at this point. I'll see if I can figure out why, in the meantime have you open a support ticket with your web host to see if there is a permission settings that needs to be changed?

Ticket submitted. Read through the web server forums and found not similar issue.

James Barnett
James Barnett
39,199 Points

Kevin Korte - The CSS files have incorrect permissions, that's why they show a 403 error because your web browser is forbidden from viewing them.