 |
HTML Help Please Search for the answer to your question before asking it! Thanks.
|
| View previous topic :: View next topic |
| Author |
Message |
phibs14
Joined: 09 Oct 2009
Posts: 15
|
| Posted: Sat Oct 10, 2009 2:36 am url code - where does it point to when making a background |
|
|
I know how to enter the code for a background image:
<style type="text/css">
body
{
background-image; url(160-1024.jpg);
background-repeat:repeat;
}
</style>
'160-1024.jpg' is my image but where do I put this image on my hard disk.
I have not uploaded anything onto a server yt as still in the starting stages so just working on the site on my laptop.
I can insert this image fine using style and scr
<img style... etc etc
src="file:///Users/timcarey/Desktop/My Website/Images/160.1024jpg" </style>
but how do i set this image to my background? |
|
|
sticks464
Joined: 31 Dec 2006
Posts: 2311
|
| Posted: Sat Oct 10, 2009 5:01 am |
|
|
When designing a website you want to emulate what will be on the server. Most servers provide you with a folder to upload your files to, so you want to have a folder on your computer that will mirror that folder.
On your computer:
Create a folder to hold all your files and give it a name that references your site. This now becomes the root folder and the files inside this folder are the ones you will upload.
Create any sub-folders inside the root folder that you may need to hold images, documents, javascripts etc.
Move or copy any images, documents, html files etc. into the appropriate sub-folders inside the root folder.
The reasoning behind this structure is that you want all your files to work once uploaded and it is also a central point to upload from so you don't have to look all over your computer for files.
Now when you make a link to a file, be it an image, text or html it will be entered as
Code: background-image; url(160-1024.jpg);
<a href="#"><img src="160-1024.jpg"></a>
and the browser knows that it does not have to look outside the root folder to find this file. The path above means the image is in the root directory folder.
If you created a folder to contain your images the path would be
Code: background-image; url(images/160-1024.jpg);
<a href="#"><img src="images/160-1024.jpg"></a>
This path indicates the file is inside a folder named images which is inside the root directory. |
|
|
phibs14
Joined: 09 Oct 2009
Posts: 15
|
| Posted: Sat Oct 10, 2009 5:26 am |
|
|
Hi,
Thanks for all the info.
however I still don't quiet understand.
I'm using a mac. Not sure that make smuch difference but I've created a folder on my desktop and this contains a folder called images which is where my images.
But it still doesn't work. how does the comuter know this folder ' images ' is the one i want to use. there could be another folder called imagines.
and what is the root directory..?
Sorry for the dum ass questions but really confused by all this.. :? |
|
|
sticks464
Joined: 31 Dec 2006
Posts: 2311
|
| Posted: Sat Oct 10, 2009 6:20 am |
|
|
Quote: I'm using a mac.
Doesn't make a difference.
Quote: I've created a folder on my desktop...
and what is the root directory..?
This folder is the root directory or root folder, which means it contains all files necessary for the site to work.
Quote: how does the comuter know this folder ' images ' is the one i want to use.
Browsers know to look inside the root folder because the file path is relative to the root folder which means the file it is looking for is inside the root.
Browsers cannot search your hard drive, that's why your images do not show up if the path includes the hard drive letter.
Are you using a wysiwyg editor (Dreamweaver etc.)? These editors sometimes put in the wrong path if you are using drag and drop or point and click. If the editor puts in a path to the hard drive you must edit it to point to the correct file location. |
|
|
phibs14
Joined: 09 Oct 2009
Posts: 15
|
| Posted: Sat Oct 10, 2009 6:38 am |
|
|
| using sandvox. although all the alterations I'm making I'm thinking of using dreamweaver or something simular. |
|
|
sticks464
Joined: 31 Dec 2006
Posts: 2311
|
| Posted: Sat Oct 10, 2009 7:27 am |
|
|
| I am not a Mac user so I am unfamiliar with this editor. Do you have a file window in this editor that shows all the files on your computer, like a mini explorer? If so you should be able to define a site so only the files inside the site folder show. |
|
|
phibs14
Joined: 09 Oct 2009
Posts: 15
|
| Posted: Sat Oct 10, 2009 1:19 pm |
|
|
the program stores all its files in one mainfile.. if that makes sense
i then have to right click on the mainfile and select 'show package contents'
actually thinking about it - this is where i may have to place the image file, I shall give it a go tmr.
thanks for all the help.
if all else fails I'll just wait till I get and server to put in all up onto,. then play around with it on there.
should be easier. |
|
|
| |
|
|
|
Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group
|