CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 6th, 2013, 01:47 PM
tomcat13 tomcat13 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 5 tomcat13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m 44 sec
Reputation Power: 0
Unhappy New Member - Images won't load on webpage. Where am I going wrong?

Hi, I'm a noob. Most of what I have learned so far has been working except for adding an image using CSS. This is really frustrating.

Details:

I'm using a Mac, Snow Leopard, Text Wrangler, and or Komodo. html file is on desktop, as is image. Ive tried different file extensions for the image, I've tried adding quotes around the photo file that lies within the parentheses.

Here is what I have:


<html>
<head>

<style type= "text/css">

body {background-image: url (purple fish.jpg); background-color: gray;
}

</style>
</head>

<body>
</body>
</html>


Thanks.

Reply With Quote
  #2  
Old March 6th, 2013, 04:21 PM
DonR DonR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 488 DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 29722 Folding Title: Starter FolderFolding Points: 29722 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 2 Days 18 h 12 m 49 sec
Reputation Power: 216
you shouldn't be using files with spaces in their names.

in this case you could try this:
Code:
<html>
<head>

<style type= "text/css">

body {background-image: url("purple%20fish.jpg"); background-color: gray;
}

</style>
</head>

<body>
</body>
</html>

and see if it works.

Also, make sure your image is in the same folder as that HTML file since thats how its referenced in the CSS section.
Comments on this post
tomcat13 agrees!

Reply With Quote
  #3  
Old March 6th, 2013, 08:27 PM
tomcat13 tomcat13 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 5 tomcat13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m 44 sec
Reputation Power: 0
Don's THE man!

It was the space in the file name as you said. It didn't work at first with that 20 percent value, but when I took that out and just made it purplefish.jpg, it worked! The little image tiled my page.

I haven't been studying code for for a day or so since this happened. I was getting frustrated to where I just wanted to give up. So thanks a lot for helping me. I appreciate it.

Reply With Quote
  #4  
Old March 6th, 2013, 08:31 PM
DonR DonR is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 488 DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)DonR User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 29722 Folding Title: Starter FolderFolding Points: 29722 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 2 Days 18 h 12 m 49 sec
Reputation Power: 216
yea, spaces in file names or even in file paths can cause lots of problems [and stress] for those trying to deal with them.
If you still want to break the file name up, I suggest using - or _ between the words, but, not spaces.

In any case, glad you have things working for you now.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > New Member - Images won't load on webpage. Where am I going wrong?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap