Help - Search - Members - Calendar
Full Version: I'm Free Geocities website and can't get CSS link to work
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
Formula1
HI people
I'm totally new to html and css and decided to learn them by getting a free website from Geocites. Now, I have tried to link a very simple CSS file to my html and it just will NOT work. However, when I do an internal CSS it works fine. I'll post the link here:

<link type="text/css" rel="stylesheet" href="/recipes/\\My Menu Recipes\CSS Files\RecipeStyles.css" />









Here is the index file that calls all of my links. They all work fine except for the CSS link:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>recipes new title</title>

<link type="text/css" rel="stylesheet" href="/recipes/\\My Menu Recipes\CSS Files\RecipeStyles.css" />

</head>

<body>
<p><img src="/recipes/\\My Menu Recipes\Images\Website Logos\Menu Web Site Logo.jpg" alt="" width="75%" height="65%" /></p>
<h1>Recipes</h1>
<p> </p>
<!--This is a table containing the names and links of my recipes; It serves as the main page navigation menu-->
<table style="width: 700;" border="3">
<tbody>
<tr>
<td><strong><a href="/recipes/\\My Menu Recipes\Spaghetti and Meatsauce.html">Spaghetti and Meatsauce</a></strong></td>
<td><strong><a href="/recipes/\\My Menu Recipes\Ribeye.html">Ribeye Steak</a></strong></td>
<td><strong><a href="/recipes/\\My Menu Recipes\Meatloaf.html">Meatloaf</a></strong></td>
</tr>
<tr>
<td><strong><a href="/recipes/\\My Menu Recipes\Chicken Parmesan.html">Chicken Parmesan</a></strong></td>
<td><strong><a href="/recipes/\\My Menu Recipes\Oven Beef Stew.html">Oven Beef Stew</a></strong></td>
<td><strong><a href="/recipes/\\My Menu Recipes\Taco.html">Tacos</a></strong></td>
</tr>
</tbody>
</table>
</body>
</html>



Thanks in advance
Frederiek
Don't use the single and double backslashes anywhere, only single forward slashes.
Formula1
QUOTE(Frederiek @ Nov 22 2015, 09:35 AM) *

Don't use the single and double backslashes anywhere, only single forward slashes.



I agree that this looks crazy odd. I'm going to try and get the forward slashes to work. I'm having some difficulty figuring out the exact file paths to use on the Geocities host. It's more difficult than doing a site on my computer for this reason.
Formula1
QUOTE(Formula1 @ Nov 22 2015, 09:42 AM) *

QUOTE(Frederiek @ Nov 22 2015, 09:35 AM) *

Don't use the single and double backslashes anywhere, only single forward slashes.



I agree that this looks crazy odd. I'm going to try and get the forward slashes to work. I'm having some difficulty figuring out the exact file paths to use on the Geocities host. It's more difficult than doing a site on my computer for this reason.



Actually, I have figured out how to link properly to the external CSS file....Finally. And I have used all forward slashes. However, I have one more question. Why must I use three forward slashes to go into the first subdirectory called "My Menu Recipes"??

<link type="text/css" rel="stylesheet" href="/recipes///My Menu Recipes/CSS Files/TeloStyles.css" />

I have to do this in all of my links.

Thanks
pandy
You shouldn't have to. You use relative URLs. They are resolved by the browser to full URLs (http://). Nothing to do with the server. If you link to a page with that odd link in it it's easier for us to figure out what's going on.

Just curious, the goecities I know closed down some 10 years ago. Is it this host you use?
http://www.geocities.ws/
Formula1
QUOTE(pandy @ Nov 22 2015, 11:24 AM) *

You shouldn't have to. You use relative URLs. They are resolved by the browser to full URLs (http://). Nothing to do with the server. If you link to a page with that odd link in it it's easier for us to figure out what's going on.

Just curious, the goecities I know closed down some 10 years ago. Is it this host you use?
http://www.geocities.ws/



Yes, I use www.geocities.ws. Also, I just tried changing from three slashes to only two and it seems to work perfectly. Sorry about the dumb questions, but I'm just learning this stuff. I think I'll go much quicker now after learning how to deal with the file paths.

Thanks
pandy
Try just one! wink.gif
Formula1
QUOTE(pandy @ Nov 22 2015, 12:16 PM) *

Try just one! wink.gif



I've done that Pandy and everything works fine, except for one interesting little problem. When I upload a new .css file to my geocities file manager everything seems to without a problem, except for one thing. The point of the external .css file is to establish the layout and attributes of ALL of your pages so that you don't have to duplicate the same commands in each and every page on your site. However, the formatting that my .css file outlines only works on the index file, but not on any of the other pages on my site. I'm getting there...slowly but surely though.

Thanks
Frederiek
Do your CSS selectors used in the css file match with the class, id or elements on the other pages?

It would be easier to see what happens if you post the url to your site.
pandy
Do you say the CSS works only if you use double slashes? That doesn't even begin to make sense. Yeah, show us.
Formula1
Oi Vey...I have all these silly problems fixed now. It was simply a matter of reading all of the reading material that I have regarding these specific issues. I can now link to my CSS files and use relative file paths. Sorry for the dumb questions and confusion.

I'm using just single forward slashes to go to the child/grandchild/greatgrandchild directories. And now understanding the use of relative file paths has made things much easier.

Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.