<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Show.aspx.cs" Inherits="Wlxxs.Web.Xxs.Show" %> <!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> html, body { padding: 10px; margin: 0 auto; height: 0 auto; max-width: 640px; font-family: "微软雅黑"; } .mainimg { text-align:center; } #Image1{height: auto; width: auto\9; width:100%;} </style> </head> <body> <div class="mainimg"> <asp:Image ID="Image1" runat="server" /> </div> </body> </html>
注:在html里面插入图片,如果想让图片自适应屏幕的小而不是宽高固定不变可以在css代码里加入
#Image1{height: auto; width: auto\9; width:100%;}
时间: 2024-10-15 21:00:30