日期:2014-05-17  浏览次数:20707 次

登录WEB界面背景图片及控件位置问题,请大家帮忙
小弟做了个电力系统的登录界面,出现了2个问题:
1、背景图片的设置,怎么可以随着不同显示器的大小发生变化(这点很惭愧,小弟用的是17寸的CRT显示器,别人的都是19寸以上的液晶显示器。。)
2、背景图片我通过设置绝对尺寸,设置了,控件位置也安排好了,但是我把IE浏览器页面稍微放大缩小一点,控件位置就发生了变化,这个怎么解决呢?
代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>系统登录</title>
  <style type="text/css">
  .style1
  {
  width: 100%;
   
  }
  .style2
  {
  width: 100%;
  height: 100%;
  }
  </style>
  </head>
<body>
  <form id="form1" runat="server" 
  style="background-image: url('images/login12.jpg')">  
  <table class="style1">
  <tr>
  <td style="width: 100%; height: 15%; ">
  <img src="images/topic.gif" style="width: 100%" />
  </td>
  </tr>
  <tr>
  <td style="background-position: center center; width: 800px; height: 340px; background-image: url('images/loginBack1.JPG'); background-repeat: no-repeat;">  
  <table class="style2">
  <tr>
  <td style="height: 48%" colspan="3">
  </td>
  </tr>
  <tr>
  <td style="height: 70%; width: 40%;" rowspan="2">
  &nbsp;</td>
  <td style="height: 30%; width: 48%;">
  <table class="style2">
  <tr>
  <td style="width: 30%; text-align: right;">
  用户名</td>
  <td style="width: 70%; text-align: center;">
  <asp:TextBox ID="TextBoxName" runat="server"></asp:TextBox>
  </td>
  </tr>
  <tr>
  <td style="width: 30%; text-align: right;">
  密码</td>
  <td style="width: 70%; text-align: center;">
  <asp:TextBox ID="TextBoxPsd" runat="server"></asp:TextBox>
  </td>
  </tr>
  <tr>
  <td colspan="2" style="text-align: center">
  <asp:Button ID="ButtonOk" runat="server" onclick=&quo