Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm new to this mvc5 environment, please help if i've missed any info.

I have tried doing the following but still doesn't display the image.

C#
body
 {
    background-image: url('../../MyTemplate/img/bac.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
}


Then I referenced my stylesheet on the login view like this.

<link href="~/Content/scss/LoginPages.css" rel="stylesheet" />

Thanks in Advanced.
Posted
Comments
Richard Deeming 28-Jul-15 11:34am    
Make sure your image is located in ~/MyTemplate/img/bac.jpg; try opening the full URL of the image in the browser.

Use your browser's developer tools to inspect the body element to see what styles are applied.

Try using Fiddler[^] to inspect the traffic between your browser and the site.

1 solution

Hi.

Instead of doing a style-sheet and referencing it I suggest you do it like this





Make sure you put everything inside the body tag , starting from the div tag.

Hope this helps you.
 
Share this answer
 
Comments
Member 11755492 28-Jul-15 11:37am    
Thank you, it worked just fine

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900