View Full Version : css locating problem
Hello, when I locate one of my css files from my public_html with the link
link rel="stylesheet" media="all" type="text/css" href="file.css" /, it works perfectly, however, when I move those files into a nother file within public_html called "css" and put this as the code
link rel="stylesheet" media="all" type="text/css" href="http://www.website.com/css/file.css" /, it does not work. Can anyone tell me why please and thank you!
BLiZZaRD
12-31-2007, 01:42 AM
link rels are relative, and it SHOULD work with the absolute as you have it, so 1) be sure the folder is readable (CHMOD 644 or 755) and 2) that the file is actually in the folder.
otherwise just use a relative one:
<link rel="stylesheet" type="text/css" href="css/file.css">
sometimes you will also need a forward slash before the directory:
<link rel="stylesheet" type="text/css" href="/css/file.css">
The folders readable; it's CHMOD is 755 and I used the one with the forward slash infront and it still does not work.
Medyman
12-31-2007, 03:03 AM
Are you sure that the path is correct? When you input http://www.website.com/css/file.css into your browser, does it direct you to download the correct file?
I used it as example and the link that I have it as in my code works perfectly. Thanks!
Anyone please and thank you!
BLiZZaRD
01-02-2008, 02:43 AM
The folders readable; it's CHMOD is 755 and I used the one with the forward slash infront and it still does not work.
did you use the one without the forward slash?
I fail to see how it isn't working wither way though, unless you aren't closing something.
Could you link to the page or post your whole <head> section here?
http://www.athletes4excellence.com/layout.php That's the page, however, I have the file in public_html and have it linked to there. If I were to add "css/menu.css" instead of "pro_dropline.css" there would be menu.css in css which is the same file as "pro_dropline.css" only with a different name.
BLiZZaRD
01-02-2008, 03:33 AM
Replace
<link rel="stylesheet" media="all" type="text/css" href="pro_dropline.css" />
With:
<link rel="stylesheet" type="text/css" href="css/menu.css">
BLiZZaRD
01-02-2008, 03:44 AM
<link rel="stylesheet" type="text/css" href="/css/menu.css">
You still have the forward slash before the css.. remove that. The one in the IE conditional is perfect.
(of course you don't need that conditional either)
I tried it with the "css/menu.css" and did not work, then I thought about trying it with a forward slash. But now I have it changed back to without the slash.
BLiZZaRD
01-02-2008, 03:59 AM
Okay.. hang on a second...
what about it isn't working? ( I see some problems, but with the whole test page, which may be because it is a test page) So please tell me what it is or is not doing?
Well what is not working is that it is not showing the images. Also, since the images are located in images/image.image and there is no folder named "images" and no images, it cannot find the images to show. So theres the problem! Man, how do you do it, everytime you help me, my problem is solved! So, here is the menu.css
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/pro_dropline.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
.nav {
height:35px;
background: url(pro_line_0.gif) repeat-x;
position:relative;
font-family:arial, verdana, sans-serif;
font-size:11px;
width:750px;
z-index:500;
}
.nav .table {
display:table;
margin:0 auto;
}
.nav .select,
.nav .current {
margin:0;
padding:0;
list-style:none;
display:table-cell;
white-space:nowrap;
}
.nav li {
margin:0;
padding:0;
height:auto;
float:left;
}
.nav .select a {
display:block;
height:35px;
float:left;
background: url(pro_line_0.gif);
padding:0 30px 0 30px;
text-decoration:none;
line-height:35px;
white-space:nowrap;
color:#ddd;
}
.nav .current a {
display:block;
height:35px;
float:left;
background: url(pro_line_2.gif);
padding:0 0 0 15px;
text-decoration:none;
line-height:35px;
white-space:nowrap;
color:#fff;
}
.nav .current a b {
display:block;
padding:0 30px 0 15px;
background:url(pro_line_2.gif) right top;
}
.nav .select a:hover,
.nav .select li:hover a {
background: url(pro_line_1.gif);
padding:0 0 0 15px;
cursor:pointer;
color:#fff;
}
.nav .select a:hover b,
.nav .select li:hover a b {
display:block;
float:left;
padding:0 30px 0 15px;
background:url(pro_line_1.gif) right top;
cursor:pointer;
}
.nav .select_sub {
display:none;
}
/* IE6 only */
.nav table {
border-collapse:collapse;
margin:-1px;
font-size:1em;
width:0;
height:0;
}
.nav .sub {
display:table;
margin:0 auto;
padding:0;
list-style:none;
}
.nav .sub_active .current_sub a,
.nav .sub_active a:hover {
background:transparent;
color:#f00;
}
.nav .select :hover .select_sub,
.nav .current .show {
display:block;
position:absolute;
width:750px;
top:35px;
background:url(back_0.gif);
padding:0;
z-index:100;
left:0;
text-align:center;
}
.nav .current .show {
z-index:10;
}
.nav .select :hover .sub li a,
.nav .current .show .sub li a {
display:block;
float:left;
background:transparent;
padding:0 10px 0 10px;
margin:0;
white-space:nowrap;
border:0;
color:#444;
}
.nav .current .sub li.sub_show a {
color:#088;
cursor:default;
background:url(back_1.gif);
}
.nav .select :hover .sub li a:hover,
.nav .current .sub li a:hover {
visibility:visible;
color:#088;
background:url(back_1.gif);
}
How do I locate images that are outside of folders?
Thanks again Blizzard!
Wrapped the code in
tags.
BLiZZaRD
01-02-2008, 04:27 AM
Well, one good thing is that you got this from Stu. He is a great guy!
The zip file should include the folder and images. just upload it to the server.
OR, make a folder for your images yourself and upload the images to it then change the css to match.
The codes you are looking for in the CSS look like:
url(pro_line_0.gif)
I found 7 in what you just posted. Locate those photos and upload them. then you will need to change the path to something like:
url(images/pro_line_0.gif)
Yup, just checked, 5 images total in the zip file from Stu's site. no folder. Make a folder and upload them to it.
Yeah, he's really great! Well, I have the images in public_html in images, so is it possible to link to the images/images.images without having to put the full url?
BLiZZaRD
01-02-2008, 04:44 AM
yup.
directory_name/image_name.ext
so like this:
url(images/pro_line_0.gif)
Just make sure you do it in all 7 spots.
But I do have it as "images/pro_line_0.gif", but there are no folders as "images" in the folder "css" however "images/pro_line_0.gif" is located in public_html and I want it to link to there. Do I just write down "public_html/images/pro_line_0.gif"?
BLiZZaRD
01-02-2008, 05:04 AM
No. the public_html directory is your main domain. http://yoursite.com is the same (to the server) as http://public_html
So make a directory named "images" inside the public_html directory, place the images in that, and link to as stated and you will be golden :)
Thanks, so to link to files outside of folders, I must use the complete URL?
BLiZZaRD
01-02-2008, 05:25 AM
not always. But it is a good idea to use complete urls wherever possible. It avoids confusion and helps with different browser display issues, as well as saves you having to redo everything should you one day switch hosts and end up on a different server type (Linux vs Windows servers for example)
That's true, thanks for your great help again Blizzard. You are my hero, always there when I need help!
One completely off topic last question. I have a gallery installed on my website, along with my smf forum, and an arcade, however, I was wondering if it is possible to merge my members of all those categories and make them have the same accounts when signing up, and the sign up is one page for the forum, arcade and gallery.
BLiZZaRD
01-02-2008, 06:00 AM
It can be done.
Start a new topic in the "Other thread" and we will go from there :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.