Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7691133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:33:11+00:00 2026-05-31T20:33:11+00:00

I am having trouble displaying an background image in my ASP.NET MVC 2 application.

  • 0

I am having trouble displaying an background image in my ASP.NET MVC 2 application. Currently, In ~/Views/Shared/Site.master, I set my link to the style sheet to:

<link href="<%:@Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css" />

The image I plan to display is in my ~/Content/Images/Designs.png

Here is what I have tried

body
{
    background-image: url(~/Content/Images/designs.png); 
    background-repeat: repeat;  
    font-size: .75em;
    font-family: Verdana, Helvetica, Sans-Serif;
    margin: 0;
    padding: 0;
    color: #696969;
}

Other Tries Included:

background-image: url(./Content/Images/designs.png); 
background-image: url(Content/Images/designs.png); 
background-image: url(Images/designs.png); 

none of the above tries worked. What can I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:33:13+00:00Added an answer on May 31, 2026 at 8:33 pm

    The url inside a CSS file is relative to the location of the CSS file.

    So if we suppose that you have ~/content/foo.css and you want to include ~/images/foo.png here’s how to reference it inside foo.css:

    background-image: url(../images/foo.png); 
    

    Don’t use any ~ inside a CSS file. It has no meaning.

    So in your case if the CSS file is ~/Content/Site.css and you want to reference ~/Content/Images/Designs.png the correct syntax is:

    background-image: url(images/designs.png); 
    

    If this doesn’t work for you there might be different causes:

    • The image doesn’t exist at that location
    • You didn’t specify width and height to the containing element so you don’t see the image

    What I would recommend you is to use FireBug and inspect the corresopnding DOM element to see exactly what styles and images are applied to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble with displaying image from db. I think that method for saving
I'm having trouble displaying SOME images on my android app. Just normal display image
I am having trouble displaying an image from the internet on my html page.
I'm new to using WPF and GDI, and I'm having trouble displaying an image.
I'm having trouble displaying an image in a UIWebView. I retrieve html content from
I'm having trouble performing a search operation in the background, and displaying the results
I'm having trouble displaying a multi-line UILabel in a custom UITableView cell. I'm currently
I'm having trouble displaying a Base64 image inline. How can I do it? <!DOCTYPE
So I'm creating a layout for my site. I'm having trouble with displaying my
I am having trouble displaying a raw YUV file that it is in NV12

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.