| View previous topic :: View next topic |
| Author |
Message |
Vagilik Veteran Contributer

Joined: 07 Jul 2009 Posts: 494 Location: Las Vegas, NV United States
|
Posted: Sun Nov 08, 2009 7:00 pm Post subject: Yes I've tried Google Minty :P |
|
|
Which is why I think I fail at this; I might have a hard time explaining this, whih makes it hard to search. I am trying to link an image to my CSS, but its back a directory and up a directory. anyone know the command line to go back and then back up. (i know once im back to root i can just use "/" to go to my IMG directory)
Any help greatly appreciated.
I tried searching html directory structure, html directory tree, and html directory
Thanks all! _________________ Keyboard not connected, press F1 to continue. |
|
| Back to top |
|
 |
AVARiCE Lowering the Tone Since 2005

Joined: 23 Sep 2005 Posts: 5780 Location: London, England
|
Posted: Sun Nov 08, 2009 9:39 pm Post subject: |
|
|
I'm guessing "back" refers to the parent folder and "up" means another folder in that folder.
As such, you'll want to go back and then type the new folder's name, followed by the file.
Eg: To go from <Root>/CSS/Main.CSS to <Root>/Images/Header.png
You need to use this operator:
../Images/Header.png
Ie <back>/<folder name>/<file name with extension>
There is no "up" operator, you just name the folder.
I think that's what you mean anyway
~ AVARiCE _________________
|
|
| Back to top |
|
 |
Vagilik Veteran Contributer

Joined: 07 Jul 2009 Posts: 494 Location: Las Vegas, NV United States
|
Posted: Mon Nov 09, 2009 12:15 am Post subject: |
|
|
yeah i think thats about what im looking for. i tried .. already. maybe im doing something else wrong. thanks though! _________________ Keyboard not connected, press F1 to continue. |
|
| Back to top |
|
 |
Vagilik Veteran Contributer

Joined: 07 Jul 2009 Posts: 494 Location: Las Vegas, NV United States
|
Posted: Mon Nov 09, 2009 4:48 pm Post subject: |
|
|
Ok heres what my style sheet looks like:
| Code: | <head>
<style type="text/css">
body
{background-image:url('../img/hacker.gif')}
</style></head> |
And here's what my page looks like:
| Code: | <html>
<head><link rel="stylesheet" type="text/css"
href="/css/background.css"/>
<title>About Vagilik</title>
<body>
</body>
</html> |
I'm still new at this, but I just can't figure out this simple thing and it's driving me nuts. Someone please point out my error _________________ Keyboard not connected, press F1 to continue. |
|
| Back to top |
|
 |
AVARiCE Lowering the Tone Since 2005

Joined: 23 Sep 2005 Posts: 5780 Location: London, England
|
Posted: Tue Nov 10, 2009 5:33 pm Post subject: |
|
|
Is the css folder a step below the html folder? Or is it another folder in the parent folder?
If it's the latter then you need to go:
| Code: | <html>
<head>
<link rel="stylesheet" type="text/css" href="../css/background.css" />***
<title>About Vagilik</title>
</head>***
<body>
</body>
</html> |
The asterixes are only there to show the altered lines, remove them (obviously ).
The first thing I did was change the reference to go up a directory, then into css etc. The second was to tidy up that line, there needs to be a space between the last quotes and the slash. I also put it onto one line (ie no line breaks) and separated it from the head opener - just for aesthetics and good practice
I also added a close head tag, which I don't think you had before
Tell me if it works. If not, put the css into the same folder and just reference it like that.
Talking of the CSS file, you've made some mistakes there:
| Code: | body
{background-image:url("../img/hacker.gif")} |
You don't need the html tags in the file, just the css itself. Also note that it's double quotes! Which would be the above. Personally, if I prefer a different way of formatting my CSS which you might find easier:
| Code: |
body{
background-image:url("../img/hacker.gif")
}
|
It just makes it easier to insert new lines and isolate what you've written.
Just from the way you've done this it looks like you're learning from the w3schools website. It's a great website (especially once you get more advanced) but I always feel like they've not taken enough time to get best practices in at the early stage.
Try www.html.net, they have a really good css tutorial and tell me if it helps you get on a bit better.
~ AVARiCE _________________
|
|
| Back to top |
|
 |
Vagilik Veteran Contributer

Joined: 07 Jul 2009 Posts: 494 Location: Las Vegas, NV United States
|
Posted: Mon Nov 16, 2009 4:43 pm Post subject: |
|
|
And it worked and you rock! yea i just copied and pasted from w3 and didn quite understand the structure. ill give your link a try. thanks for the help! I have been checking the forum everyday and never saw this as a new post so i just came and viewed it today lol. Wonder why that wasnt working either. Oh well it's working now. Much appreciated! _________________ Keyboard not connected, press F1 to continue. |
|
| Back to top |
|
 |
AVARiCE Lowering the Tone Since 2005

Joined: 23 Sep 2005 Posts: 5780 Location: London, England
|
Posted: Mon Nov 16, 2009 10:53 pm Post subject: |
|
|
Out of curiosity - what did you change? The HTML or the CSS? Or both maybe?
I'd say that copy pasting is bad, type everything out if only to understand it that tiny bit more - the amount of typo's you'll make which will then need debugging will be priceless. I find debugging anything is the best way of learning about it.
It's ok, the forum is quite buggy. I haven't touched CSS in about two years so it was a hell load of fun going back to it, I've got to admit
Enjoy and feel free to post up more if you get stuck (it's kinda fun)!
~ AVARiCE _________________
|
|
| Back to top |
|
 |
Vagilik Veteran Contributer

Joined: 07 Jul 2009 Posts: 494 Location: Las Vegas, NV United States
|
Posted: Tue Nov 17, 2009 12:07 am Post subject: |
|
|
Lol you just opened a can of worms AV. maybe.....im sure ill have many coding issues to come. I did have to change both to exactly how you had them (minus the astericks of course) and I hate CSS! but ill be back for more im just glad i got that style sheet so i dont have to keep repeating the code for that background on every page.
My main problem right now is with PHPBB3....but thats a topic all on it's own lol.
Thanks again for the help _________________ Keyboard not connected, press F1 to continue. |
|
| Back to top |
|
 |
|