Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply full background image in asp.net MVC

I'm new to asp.net MVC and I need to have a full background image on the login page. Im getting confused with all of the cshtmls and getting lost on where to set the full background image. Help please..

like image 632
JADE Avatar asked Aug 26 '15 09:08

JADE


People also ask

How to add background image in asp net mvc view?

You need the image and in the Shared Views folder there is a partial view for the login page, if you want a full background you cannot use a partial view, you will need to use a regular view without a layout.

How do you put a background image on a Web form?

To set the background image of a webpage, use the CSS style. Under the CSS <style> tag, add the property background-image. The property sets a graphic such as jpg, png, svg, gif, etc. HTML5 do not support the <body> background attribute, so CSS is used to change set background image.


1 Answers

I think that best solutions is to do that via style sheets (css). All styles should be in a separate css file. For beautiful code don't use in-line styling:

body {
    background-image: url('your_img_path');
    margin: 0;
}
like image 166
Marcin Avatar answered Nov 08 '22 05:11

Marcin