CSS file isn't applying

Status
Not open for further replies.

Visual3volution

New member
So I'm following this website on how to build my first website, and the .css file just won't apply to my website for some odd reason. Here's the link: http://txjake.gi9.co

Idk why it won't apply the CSS even though I linked them correctly and everything.

Can anyone help?
 

GigaGreg

Moderator
Staff member
Peter said:
It looks like you have placed the CSS file in the website's root directory: http://txjake.gi9.co/main.css

You can either move the file or change the HTML code.
Code:
<link rel="stylesheet" href="/main.css">


Peter is right, you have main.css in your main html folder. You should move it to the: <link rel="stylesheet" href="assets/stylesheets/main.css"> because you shouldn't have anything other than php or html files within your main directory.
 

Visual3volution

New member
I have done so, however the stylesheet still does not wish to apply. I even made an assets folder w/ stylesheets folder inside of that and main.css in there too. I'm totally confused right now haha.
 

GigaGreg

Moderator
Staff member
Can you please upload your css and html to js fiddle or codepen so we can see what is wrong with it ?
 

GigaGreg

Moderator
Staff member
It is weird, because it looks fine to me. Maybe clear cookies in your web browser?
I have downloaded those files and re-created your hosting directory and the css applies to the html.

In the attachements you can see what is working for me. It will be the same as your versions, but give a try copying over.
 

Attachments

  • files.zip
    3.5 KB · Views: 7

Visual3volution

New member
iGdesigner said:
It is weird, because it looks fine to me. Maybe clear cookies in your web browser?
I have downloaded those files and re-created your hosting directory and the css applies to the html.

In the attachements you can see what is working for me. It will be the same as your versions, but give a try copying over.

It still won't apply lol. Now I'm even more confused.
 

GigaGreg

Moderator
Staff member
That is strange, because I even tried on my home computer second ago, and everything works. Have you tried to open that from your computer?
 

Peter

Member
V3V, does it show correctly for you on jsfiddle? When you opened the files that IGdesigner sent, are you sure you extracted all the files before opening the HTML file?
 

Visual3volution

New member
I use a mac, and so when I click on a .html file it won't show the actual page in Safari for me. But when I open the files in Google Chrome, it'll show everything completely okay, like it'll actually have color and whatnot instead of a plain white background. Then I upload the files and everything correctly but the stylesheet just won't apply.

As for copying and pasting the codes for the index.html and main.css files into jsfiddle, it doesn't tell me anything about the CSS, but for HTML, it tells me "No need for the HTML tag, it's already in the output", "No need for the META tags", "No need for the HEAD tag, it's already in the output", and "For external CSS files use the Resources panel on the left."
 

GigaGreg

Moderator
Staff member
On your mac, what program are you using to create web stuff? I advice you to use the Brackets from Adobe, it is free and good for web editing. I am going to check that on my macbook.

It works for me very well.

I even have uploaded to a server from my macbook http://igdesigner.co.uk/test/
 

Visual3volution

New member
I must be doing something wrong... How did you upload it?

Currently, I'm using TextWrangler for the Mac but every once in awhile use Notepad++ when it works here on the Mac, too.
 

GigaGreg

Moderator
Staff member
Use Brackets from Adobe, it is free to download.

I have used filezilla. And I normally do this.

I have created a test folder with the files on your hosting, just to check if it might be some problems with the account, but clearly not.

It must be something with the Textwrangler unfortunately

http://txjake.gi9.co/test/
 

Genesis

Administrator
Staff member
You're right Ogah. The assets folder was in root. I've just moved it to the public_html directory.

@ Visual3volution. Looks as though it is working now. Check where the assets folder is. Which is where all other "public" folders are needed - not in root - but in the public_html directory.

Think is is better for you to upload your folders through the File Manager or FileZilla. As there you can see exactly what the difference is between root and public_html directory. Until you are more accomplished with Linux Web file management.

By the way, it really looks nice. I like the open and clean look of the page. Well done!
 

Visual3volution

New member
Genesis said:
You're right Ogah. The assets folder was in root. I've just moved it to the public_html directory.

@ Visual3volution. Looks as though it is working now. Check where the assets folder is. Which is where all other "public" folders are needed - not in root - but in the public_html directory.

Think is is better for you to upload your folders through the File Manager or FileZilla. As there you can see exactly what the difference is between root and public_html directory. Until you are more accomplished with Linux Web file management.

By the way, it really looks nice. I like the open and clean look of the page. Well done!

I'm kinda brushing back up on this stuff, but what exactly needed to be changed? I know you added the test folder in the public_html directory, where my assets folder was and my .html files. And by root, what do you mean and what is the root in the File Manager?

Thanks btw for the compliment. :) I do appreciate the help, too, you guys! I'm still learning a little haha.
 

Genesis

Administrator
Staff member
Visual3volution said:
I'm kinda brushing back up on this stuff, but what exactly needed to be changed? I know you added the test folder in the public_html directory, where my assets folder was and my .html files. And by root, what do you mean and what is the root in the File Manager?
NO NO NO NO!!!! Your Assets Folder or test folder was NEVER in the public_html folder. You kept loading it to your root folder and probably repeatedly deleting it from your root folder as well.

I didn't ADD anything to anywhere. I in one very basic simple easy step (every one here had been begging you to do this for the last number of posts) MOVED your ASSETS folder (that had been sitting in your ROOT folder) to your PUBLIC_HTML folder.

The public_html is the "root folder" of your domain. It is what it says it is. In order for any one to see anything, like the styles you use, it has to be loaded to your public_html. Click on your File Manager before I moved the assets folder to it, and you would have noticed there was no assets folder in public_html. So I strongly suggest that you use your File Manager or a client like FileZilla to check where your folders are.

Here is a tutorial of how to work with your folders. Strongly suggest you use FileZilla so you can see where your folders are - i.e. root or public.

[video=youtube]
 
Status
Not open for further replies.