Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-01-2011, 07:37 PM   PM User | #1
pb910
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
pb910 is an unknown quantity at this point
CSS background image help!

Hi everyone, I'm new to this forum, I joined up because I'm studying many programming and mark-up languages, and because I am stuck with using CSS background image

I'm trying to set an image as my background on my ASP.NET.
I've only started on CSS today, so I have no idea why this isn't working;

Code:
body   
{
    background-image: url('I:\COMP1551(Web Applications)\CWK\TestApp\TestApp\Images\cwcHeaderBackground.png');
    font-size: .80em;
    font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
    margin: 0px;
    padding: 0px;
    color: #696969;
}
What's confusing to me is that it appears to work in microsoft visual studios design view, but when I run the application in IE (the latest version), it appears to have no effect.

Any ideas?
pb910 is offline   Reply With Quote
Old 12-01-2011, 08:05 PM   PM User | #2
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
pb910, a warm welcome to the forums!

It is highly likely that this is your problem:
Code:
url('I:\COMP1551(Web Applications)\CWK\TestApp\TestApp\Images\cwcHeaderBackground.png');
you can always just use a shortened pathway. Say your file is in the folder CWK. To access the image, you can just use

Code:
background-image: url('/CWK/testApp/testApp/images/cwcHeaderBackground.png');
Also check to make sure you have 2 testApp folders (did you mean to do that?) Also take note that the url uses forward slashes!
Let me know how it goes

Sammy

Last edited by Sammy12; 12-01-2011 at 08:07 PM..
Sammy12 is offline   Reply With Quote
Old 12-01-2011, 08:26 PM   PM User | #3
pb910
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
pb910 is an unknown quantity at this point
Quote:
Originally Posted by Sammy12 View Post
pb910, a warm welcome to the forums!

It is highly likely that this is your problem:
Code:
url('I:\COMP1551(Web Applications)\CWK\TestApp\TestApp\Images\cwcHeaderBackground.png');
you can always just use a shortened pathway. Say your file is in the folder CWK. To access the image, you can just use

Code:
background-image: url('/CWK/testApp/testApp/images/cwcHeaderBackground.png');
Also check to make sure you have 2 testApp folders (did you mean to do that?) Also take note that the url uses forward slashes!
Let me know how it goes

Sammy
Thanks for reply,

According to the advice, it doesn't seem to work in designer view either :L
pb910 is offline   Reply With Quote
Old 12-01-2011, 08:28 PM   PM User | #4
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
what file is the background-image: ; css in ?
Sammy12 is offline   Reply With Quote
Old 12-01-2011, 08:45 PM   PM User | #5
pb910
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
pb910 is an unknown quantity at this point
Quote:
Originally Posted by Sammy12 View Post
what file is the background-image: ; css in ?
you mean the location?

I:\COMP1551(Web Applications)\CWK\TestApp\TestApp\Images\cwcHeaderBackground.png
pb910 is offline   Reply With Quote
Old 12-01-2011, 11:33 PM   PM User | #6
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
That's the location of the image. Where would be the location of the file you are using the image on?

If you are using an external stylesheet, then we need to know where that is. Wherever you used background-image: ;
Sammy12 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:46 AM.


Advertisement
Log in to turn off these ads.