.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT
wwwSW
Posted by
Aamir Hasan
on
Saturday, November 27, 2010
Total Views:
Following example shows that how to fixed background image using css in asp.net page. CSS background property is used to add image in the web page. CSS background property parameters are shown below.

If you want to fit the image size on the web page, add background-size property to 100% i did in this example.
Here’s an example.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to fixed background image using css in asp.net page | aspxtutorial.com</title>
<style type="text/css">
html, body
{
background: url(2.jpg) 0 0 fixed;
background-size: 100%;
font-family: Verdana;
}
#header
{
margin: 0 auto;
padding: 20px;
background-color: #fafafa;
width: 900px;
height: 1000px;
}
h2
{
width: 100%;
padding: 10px;
background-color: #eee;
height: 100px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="header">
<h2>
Welcome to aspxtutorial.com
</h2>
<p>
<a href="http://www.aspxtutorial.com">.NET articles</a>
</p>
</div>
</div>
</form>
</body>
</html>
Download
Fixed-Background-Image.zip (1,010.00 bytes)
See live demo
edfbeeed-7c4b-4ff4-95fd-72aab36bbedf|0|.0
Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5