在CSS中拉伸背景图像
  可能重复: 
  拉伸和缩放CSS图像背景 - 仅限CSS 
  初学者问题:这可能是一个基本问题,我可能会错过一些基本想法。  我已经看到这个问题,但我认为这不是我的问题。  我想在CSS中展开我的背景图片。  这是我的CSS代码 
  CSS: 
.BackgroundColor
{
    background-position: center center;
    margin: 0px 0px 0px 0px;
    background-image: url('Content/Tulips.jpg');//this image i want to stretch
    background-repeat: no-repeat;
    width: 1000px;
    height: 1000px;
    padding: 0px 0px 0px 0px;
}
  这是我的HTML代码 
  HTML: 
<div class="BackgroundColor">
    <div class="outerMost">
    <div class="heading" id="loginheading">
      Show Login  
    </div>
    <div class="MainSect">
        <div class="Label">
        <asp:Label ID="usernameLabel" runat="server" Text="UserName" ClientIDMode="Static"></asp:Label>
        </div>
        <asp:TextBox ID="UsernameTextBox" runat="server" CssClass="textboxes" ClientIDMode="Static"></asp:TextBox>
        <br />
        <asp:Label ID="PasswordLabel" runat="server" Text="Password" CssClass="Label" ClientIDMode="Static"></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" CssClass="textboxes"></asp:TextBox>
        <br />
        <asp:Button ID="LoginButton" runat="server" Text="Login"  
            BackColor="#00CCFF" BorderStyle="Solid" CssClass="loginButton" ClientIDMode="Static" />
    </div>
    <br />
    <br />
    <div>
        <asp:Label ID="Label1" runat="server" Text="Date of Birth" CssClass="Label"></asp:Label>
        <asp:TextBox ID="CalenderTextBox" runat="server" ClientIDMode="Static" CssClass="textboxes"></asp:TextBox>
    </div>
    <div id="tabSection">
        <ul>
            <li><a href="#basicInfo">Basic info</a></li>
            <li><a href="#Products">Products</a></li>
            <li><a href="#SavingAccount">Depositer</a></li>
        </ul>
        <div id="basicInfo">
        Basic Info will be mentioned here and bla bla bla
        </div>
        <div id="Products">
        Products and other releases should be mentioned here
        </div>
        <div id="SavingAccount">
        Information about saving account should be mentioned here and bla bla bla
        </div>
    </div>
    </div>
    </div>
  所以我想在页面上设置背景图片。忽略内部代码。  请帮助我拉伸图像,因为我的“ Style builder器未显示任何有关拉伸图像的属性。  上面提到的链接是在Html中扩展图像,但我想在CSS中完成。 
  编辑:请告诉我如何在Visual Studio中包含CSS3,因为我的CSS编辑器显示CSS2.1 
  谢谢 
  在CSS3中,您可以简单地使用background-size: cover此处记录的background-size: cover 。 
封面 :缩放图像,同时保留图像的内在高宽比(如果有),使其宽度和高度都能完全覆盖背景定位区域。
否则,请参阅此答案。
我认为这是你正在寻找的东西:
background-size: 100%;
你可以使用background-size:
http://www.w3schools.com/cssref/css3_pr_background-size.asp
下面是它的一个演示:
http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_background-size2
background-size:100%;
                        链接地址: http://www.djcxy.com/p/89207.html
                        上一篇: Stretch a background image in CSS
下一篇: Try statement syntax
