比如設置html中下面的div爲垂直水平居中,則
<div id="box"></div>
css樣式
#box{ width: 300px; height: 200px; margin-left: -150px;//寬度的一半,很重要,不然不居中,會偏右 margin-top: -100px;//高度的一半 position: absolute;//絕對定位方式 top: 50%; left: 50%; background-color: aqua;//背景顏色,便於測試查看效果 }
比如設置html中下面的div爲垂直水平居中,則
<div id="box"></div>
css樣式
#box{ width: 300px; height: 200px; margin-left: -150px;//寬度的一半,很重要,不然不居中,會偏右 margin-top: -100px;//高度的一半 position: absolute;//絕對定位方式 top: 50%; left: 50%; background-color: aqua;//背景顏色,便於測試查看效果 }
首先得確認的是,控制層框架是否採用的是struts2 1、採用Struts2的話必須在web.xml中配置<filter-mapping> <f
需求: 利用ajax實現 當輸入用戶名時,驗證該用戶名是否已經存在,如果存在,給出重新輸入用戶名,不存在,提示可以使用。簡單起見,如果用戶名不