Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    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 09:07 PM.

  • #3
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    what file is the background-image: ; css in ?

  • #5
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    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: ;


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •