Hard Klen Posted November 28, 2005 Share Posted November 28, 2005 I'm new to HTML and CSS, so I might be doing some stupid mistake, but I can't get an image as background in CSS. I've tried everything I could come up with, but I can't make it... I'm doing as it says in the guide on W3school, but...And I've got problems with getting a image to show when it is from another folder than the one where I've saved my HTML- and CSS-documents. It works in Internett Explorer, but not in Firefox.Hope somebody can help me...PS: about CSS, I can change the background color, and those other CSS-things, so the problem is not that I can't link the CSS-document with the HTML-document Link to comment Share on other sites More sharing options...
Kcarson Posted November 28, 2005 Share Posted November 28, 2005 Can you post your sample code? My guess is that there may be a problem with the location of the image, just a guess, but without seeing anything, can't say for sure. Link to comment Share on other sites More sharing options...
Hard Klen Posted November 28, 2005 Author Share Posted November 28, 2005 Well, this is how I wrote the background-image-thing in CSS, body {background-image:url('C:\Documents and Settings\Hard\Mine dokumenter\det_femte_ess.gif')}(det_femte_ess.gif is the image I'm trying to get as the background) Link to comment Share on other sites More sharing options...
maelstorm Posted November 28, 2005 Share Posted November 28, 2005 HiTry writing the url part like thisbackground-image:url("file:///C:\Documents and Settings\Hard\Mine dokumenter\det_femte_ess.gif");HTH Link to comment Share on other sites More sharing options...
Hard Klen Posted November 28, 2005 Author Share Posted November 28, 2005 Hmmm... It still doesn't work... I'll try more tomorrow...But thanks for trying to help! Link to comment Share on other sites More sharing options...
Skemcin Posted November 28, 2005 Share Posted November 28, 2005 If the image resides in the same folder that the webpage doesn, then all you need is this: body{background-image:url('det_femte_ess.gif')} There is no need to include "C:\Documents and Settings\Hard\Mine dokumenter\" since that is the absolute path to the file on your machine. Once you move your site to a web server, that will not be the location of the file and it will just show a red X and not load. Link to comment Share on other sites More sharing options...
Hard Klen Posted November 29, 2005 Author Share Posted November 29, 2005 If the image resides in the same folder that the webpage doesn, then all you need is this:CODEbody{background-image:url('det_femte_ess.gif')}I've tried that, but it dosen't work... Link to comment Share on other sites More sharing options...
Skemcin Posted November 29, 2005 Share Posted November 29, 2005 I've tried that, but it dosen't work... I think you are going to have to post a link to the page so that we can look exactly how it is coded. The little bit of code you offer doesn't seem to match the problem you are explaining. If you post a link we can review the rendered code and get to a solution much more quickly.Thanks Link to comment Share on other sites More sharing options...
Hard Klen Posted November 29, 2005 Author Share Posted November 29, 2005 I haven't posted the documents on the Internet yet, but I can give you the HTML and CSS documents if that'll help? Link to comment Share on other sites More sharing options...
Skemcin Posted November 29, 2005 Share Posted November 29, 2005 I haven't posted the documents on the Internet yet, but I can give you the HTML and CSS documents if that'll help? Please post it on the internet somewhere - nothing has to link to it and you can change the file name to protet the identity (lol). Its just easier to see and troubleshoot if the file is online - my environment is and will be different that yours. Link to comment Share on other sites More sharing options...
Hard Klen Posted November 29, 2005 Author Share Posted November 29, 2005 I'd like to, but I'm too new to HTML, so I don't know how to actually post something on HTML-websides yet.I'm a stupid newbie... Link to comment Share on other sites More sharing options...
Jonas Posted November 29, 2005 Share Posted November 29, 2005 Hey, don't beat yourself up man. Since you're norwegian, you can try setting up an account on http://www.home.no/medlem/ny.cgi for free server space. It will only give you about 20Mb's of space, but it's enough for a small website. If you have any questions about its use, you can PM me, asking in English or Norwegian, whichever's easier to understand. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now