asp.net 利用jquery讓登入頁面垂直居中顯示
直接原始碼,有不懂的請留言。
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>許可權登入</title>
<link href="css/master.css" type="text/css" rel="stylesheet" />
<script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
divresize();
});
/**自應高度**/
function divresize() {
resizeU();
$(window).resize(resizeU);
//這個方法是讓無論,瀏覽者電腦螢幕如何。都能讓div居中,垂直居中,div的id是AT
function resizeU() {
//css("width")這樣獲取的是 數字加px,
var logindiv_width = $("#AT").css("width").replace("px", "");
//css("height")這樣獲取的是 數字加px
var logindiv_height = $("#AT").css("height").replace("px", "");
$("#AT").css({
"margin-left": ($(document).width() - logindiv_width) / 2,
"margin-top": ($(document).height() - logindiv_height) / 2,
});
}
}
</script>
</head>
<body class="move">
<div id="AT">
<div class="header">
<div class="headerLogo"><img src="images/headerLogo.gif" /></div>
</div>
<div class="main">
<div class="login">
<div class="loginTitle">
使用者許可權管理系統
</div>
<div class="loginForm">
<form>
<div class="prompt">請輸入正確的使用者名稱或密碼!</div>
<input type="text" value="請輸入使用者名稱" class="loginUser" />
<input type="text" value="請輸入密碼" class="loginPassword"/>
<div class="rememberPs">
<input type="checkbox" class="mr10" />記住密碼
</div>
<input type="button" class="loginBtn">
</form>
</div>
</div>
</div>
<div class="footer">技術支援:安徽省XXX有限公司</div>
</div>
</body>
</html>
如下圖所示:相關文章
- hosts引起hotmail登入頁面無法顯示AI
- jquery登入頁面效果圖jQuery
- Vue專案中使用Html+Css使div在頁面中居中顯示(水平+垂直)VueHTMLCSS
- 利用jQuery實現頁面漸顯效果jQuery
- asp.net mvc 中利用jquery datatables 實現資料分頁顯示ASP.NETMVCjQuery
- css實現div在頁面中永遠垂直水平居中CSS
- Flex佈局-垂直居中並換行顯示內容Flex
- asp.net 在使用母版頁的子頁面cs後臺程式碼中控制母版頁中的登入控制元件顯示ASP.NET控制元件
- IE8中jQuery.load()載入頁面不顯示的原因jQuery
- .net頁面載入顯示word檔案
- Asp.net 2.0 用Membership自己寫登入頁面ASP.NET
- css如何設定文字在li元素中垂直居中顯示CSS
- ASP.NET 個人資訊註冊頁面,並跳轉顯示ASP.NET
- Qt 讓彈出的視窗居中顯示QT
- jQuery點選頁面其他地方隱藏顯示的元素jQuery
- css讓一個容器水平垂直居中CSS
- 如何讓Spring MVC顯示自定義的404 Not Found頁面SpringMVC
- Qt如何讓彈出的視窗居中顯示QT
- Qt介面設計如何讓文中居中顯示?QT
- asp.net 頁面載入ASP.NET
- 淺談居中問題(水平居中、垂直居中、水平垂直居中)
- div在網頁中垂直居中效果網頁
- 頁面載入順序jQueryjQuery
- 如何讓文字垂直居中對齊文字框
- 簡單的網頁登入頁面網頁
- javaWeb登入註冊頁面JavaWeb
- 登入頁面使用ReactiveCocoaReact
- 利用JQuery的load函式動態載入頁面 以及jQuery動態載入頁面和請求所返回的資料jQuery函式
- CSS如何讓浮動導航欄元素居中顯示CSS
- 如何讓win32對話方塊居中顯示Win32
- QWidget居中顯示
- div垂直居中-CSS元素垂直居中方法CSS
- 灌水帖 asp.net非法請求時跳轉到登入頁面ASP.NET
- 用CSS讓未知高度內容垂直方向居中CSS
- html之如何讓多個並列的div居中顯示HTML
- 強制頁面顯示在框架裡框架
- 水平居中、垂直居中、水平垂直居中、浮動居中、絕對定位居中…….幫你搞定
- 自定義登入和登出頁面