CSS Linking Problem

Grafight

New Member
Originally when i started making this website I made the overall folder to put everything in and inside that folder i didn't make a CSS folder to put my stylesheets in but instead just put them with the normal html files...Now that i'm about ready to host my site i want to put my stylesheets into a seperate CSS folder

The problem is i try to replace:
<link rel="stylesheet" href="menu_style.css" type="text/css" />
<link rel="stylesheet" href="background.css" type="text/css"/>

With:

<link rel="stylesheet" href="CSS/menu_style.css" type="text/css" />
<link rel="stylesheet" href="CSS/background.css" type="text/css" />

it messes my html pages all up....

please help...thanks
 

anna

New Member
Originally when i started making this website I made the overall folder to put everything in and inside that folder i didn't make a CSS folder to put my stylesheets in but instead just put them with the normal html files...Now that i'm about ready to host my site i want to put my stylesheets into a seperate CSS folder

The problem is i try to replace:
<link rel="stylesheet" href="menu_style.css" type="text/css" />
<link rel="stylesheet" href="background.css" type="text/css"/>

With:

<link rel="stylesheet" href="CSS/menu_style.css" type="text/css" />
<link rel="stylesheet" href="CSS/background.css" type="text/css" />

it messes my html pages all up....

please help...thanks

My guess is it's about the path but I could be wrong. It would be MUCH easier if you posted a link. But my guess is it should be something like:

<link rel="stylesheet" href="../CSS/menu_style.css" type="text/css" />
 

smoovo

New Member
My guess is it's about the path...

That's right, it has to be the path.

Check:
1. if the folder you have made named "CSS" and not "css".
2. if the folder "CSS" placed in the root directory.
3. if you have images path inside the stylesheet, you need to place "../" before the original path.

This is the most common problems with linking stylesheets to a document.

- Enjoy. :)
 

PixelPusher

Super Moderator
Staff member
That's right, it has to be the path.

Check:
1. if the folder you have made named "CSS" and not "css".
2. if the folder "CSS" placed in the root directory.
3. if you have images path inside the stylesheet, you need to place "../" before the original path.

This is the most common problems with linking stylesheets to a document.

- Enjoy. :)

1. File path names are not case sensitive. While it is better to write them just how they are written, if you use caps instead it will not break the path.
3. Yes! Be sure to check all linked image paths in your css background properties.

Yes it is the path.
By adding a "/" at the start of your href value, you tell the browser to start at the root and look for a folder named "CSS".

HTML:
<link type="css/text" href="/CSS/stylesheet.css" rel="stylesheet" />
 

Grafight

New Member
I still can't figure it out...My path names are all good but it still isn't linking it to the html document...

Maybe it is because I changed the location AFTER i had already had the regular location...

Also how do i know if it is placed in the root directory
 

smoovo

New Member
Go through this steps:

1. Open your FTP (if it's open close it and open again).
2. Look if you have in the opened window file named "index", "home" or "welcome".
3. If there is one of those, look if you have a folder named "CSS" too.
4. If you have it, open it.
5. See if you have there a file named "style.css".

If all this (exactly) process went well, your problem isn't your path. You should post your Main and CSS pages script.

Bottom line: You have linked your CSS file under CSS folder, so each page that using it will look for folder named "CSS" in the same directory as they are, and will look for file named "style.css" in this folder.

Let me know if it worked or if not.
 

Grafight

New Member
I'm using filezilla and i see the css folder with the css file inside of it...it still isn't working but do i need to put anything on my css text page? Do i need to make a folder for all my html pages too?...i wish i could show you the site but it isn't up yet cuz i'm waiting for my host to get my domain
 

smoovo

New Member
You have on your keyboard "Print Screen" key, click it and go to photoshop or similar program, open new document and click Edit > Paste. Save this image and PM me.

I need to see your CSS file (style.css) and your FileZilla screen.
 

PixelPusher

Super Moderator
Staff member
You have on your keyboard "Print Screen" key, click it and go to photoshop or similar program, open new document and click Edit > Paste. Save this image and PM me.

I need to see your CSS file (style.css) and your FileZilla screen.

Ahh good ole print screen...works wonders :D
 
Top