css怎么制作一个登录页面

html-css054

css怎么制作一个登录页面,第1张

CSS+HTML可以制作一个登录静态页面,做不了动态页面。

表单代码:

<form name="form" method="POST" action="">

<input type="text" value="用户名" />

<input type="password" value="密码" />

<input type="submit" name="button" value="登录" class="xiaoka_tj"/>

</form>

新建一个html文件,命名为test.html,用于讲解css怎么让背景图片固定不动。

1、在test.html文件中,创建多个p标签,让页面产生滚动条。

2、在css样式中,使用background-image属性设置页面的背景图片为2.jpg,将background-repeat属性设置为no-repeat,让背景图片不重复显示。

3、在css样式中,再将background-attachment属性设置为fixed,实现当页面滚动时,背景图片在页面中固定不动。

4、在浏览器打开test.html文件,向下滚动页面,查看结果。