下面是整个界面的代码,以及两张图片。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %><!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
{
text-align: center;
}
<style type="text/css">
body{text-align:center}
#div1
{
position:relative;
width:1440px;
left:50%;
margin-left:-720px;
}
</style></head>
<body> <div id="div1">
<form id="form1" runat="server">
<div style="position: absolute; background-image: url('button/首页背景.jpg'); background-repeat: no-repeat; top: 0px; left: 0px; width: 1440px; height: 655px; text-align: center;">
<div style="width: 1440px; top: 655px; left: 0px;">
</div>
</div>
</form>
</body>
</html>问题究竟出在哪里?我这代码可以实现在任何分辨率下都水平居中,但是在vs2010的视图里不行。求解!怎么办?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %><!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
{
text-align: center;
}
<style type="text/css">
body{text-align:center}
#div1
{
position:relative;
width:1440px;
left:50%;
margin-left:-720px;
}
</style></head>
<body> <div id="div1">
<form id="form1" runat="server">
<div style="position: absolute; background-image: url('button/首页背景.jpg'); background-repeat: no-repeat; top: 0px; left: 0px; width: 1440px; height: 655px; text-align: center;">
<div style="width: 1440px; top: 655px; left: 0px;">
</div>
</div>
</form>
</body>
</html>问题究竟出在哪里?我这代码可以实现在任何分辨率下都水平居中,但是在vs2010的视图里不行。求解!怎么办?
解决方案 »
- 这个正则匹配哪里不对了呢
- 新建了个asp.net网站 但是在浏览器中不能查看! 高手支招!
- 关于触发器
- asp.net popup页面 向父页面传值的问题,让父页面响应,并显示传过去的DATATABABLE ,同时子页面仍在最上 ,急
- 请javascript高手帮忙,谢谢.
- 急!!! 怎么设下拉菜单的第一项为绑定外的值???
- datalist控件中onselectedindexchanged不触发
- 奇怪,window.showModalDialog('ereZdiTantosya.aspx'); 打开的窗口,无论点任何按钮,都是弹出一个新窗口
- asp.net文件下载问题,急急急,在线等待。
- 服务器端控件如何取得Html控件的值?
- 阿里大鱼 短信接口 .net 做出来的成功案例有吗?
- 求助:页面中的table分页显示
@sp1234 @Chinajiyong @renyiqiu @FoxDave
难道没有什么补丁可以解决这个问题吗?我的做了很多控件的图片,必须靠里面的绝对定位控制各个div的位置,所以必须看到vs2010中的完整视图……
我知道视图里面显示的很不准确,文字位置和浏览器的都不一样,但这都没关系,我可以以浏览器为准。
但是现在直接没了一半,我根本调不了无法定位。
你们是怎么解决像我这种做了上百张背景打算用绝对定位移动div的?