如何在登录页面的图片中精确放置输入框?
如下图的登录图片,图中预留了用户名、密码、确定按钮等位置,请问如何把我的户名、密码输入框精确放到图片的位置中?如果图片在各种分辨率的显示下居中的话,户名、密码输入框的left位置应该是不一样的吧,如何兼容各种分辨率呢?请各位高人指教!
[解决办法]
先把大图的的DIV的css设置为position:relative,再用position:absolute定位一个DIV,最后就在这个DIV中写form表单就是了。
[解决办法]
和分辩率也没啥关系吧!
背景图片写在body里,background:url(xx.jpg) no-repeat center top
你内容容器,直接写宽度,然后margin:0 auto;这样不就一直在中间的么?
[解决办法]
function onresize() //函数:获取尺寸
{
var winWidth = 0;
var winHeight = 0;
//获取窗口宽度
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
//获取窗口高度
if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测,获取窗口大小
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
//***增加自己的处理
}