怎样用div+css制作一个登录页面

html-css03

怎样用div+css制作一个登录页面,第1张

用div+css制作一个登录页面,首先需要做的就是将这个登录界面的布局给构想好,然后在使用div去布局出来,一般都要结合表单,因为是需要和数据库结合的,至于的具体的界面,看下代码:

<html>

<head>

<meta charset="UTF-8">

<title>淘宝登录</title>

<link rel="stylesheet" type="text/css" href="../static/css/index.css" />

<script type="text/javascript">

<{if $message !=''}>

alert("<{$message}>")

<{/if}>

</script>

</head>

<body>

<div id="logo">

<div class="logotop">

<div class="yanz">

<h2>登录</h2>

<form action="logo.php" method="post">

<span style="display:blockheight:27pxwidth:27pxbackground-image:url(../static/images/logozh.jpg)float:left"></span>

<input type="text" name="uname" style="height:26px"/><br/>

<span style="display:blockheight:27pxwidth:27pxbackground-image:url(../static/images/logomm.jpg)float:left"></span>

<input type="password" name="pwd" style="height:26px"/>

<p><a href="">忘记登录密码?</a></p>

<input type="submit" value="" style="width:254pxheight:37pxbackground-image:url(../static/images/logodl.jpg)cursor: pointer"/>

</form>

</div>

</div>

</div>

</body>

</html>

这个代码有些图片的地址,需要根据要求去改,这些是我自己写的,然后就是传输的文件,action那,接受的文件也是需要定义的。

用div+css制作一个登录页面,首先需要做的就是将这个登录界面的布局给构想好,然后在使用div去布局出来,一般都要结合表单,因为是需要和数据库结合的,至于的具体的界面,看下代码:

<html>

<head>

<meta charset="UTF-8">

<title>淘宝登录</title>

<link rel="stylesheet" type="text/css" href="../static/css/index.css" />

<script type="text/javascript">

<{if $message !=''}>

alert("<{$message}>")

<{/if}>

</script>

</head>

<body>

<div id="logo">

<div class="logotop">

<div class="yanz">

<h2>登录</h2>

<form action="logo.php" method="post">

<span style="display:blockheight:27pxwidth:27pxbackground-image:url(../static/images/logozh.jpg)float:left"></span>

<input type="text" name="uname" style="height:26px"/><br/>

<span style="display:blockheight:27pxwidth:27pxbackground-image:url(../static/images/logomm.jpg)float:left"></span>

<input type="password" name="pwd" style="height:26px"/>

<p><a href="">忘记登录密码?</a></p>

<input type="submit" value="" style="width:254pxheight:37pxbackground-image:url(../static/images/logodl.jpg)cursor: pointer"/>

</form>

</div>

</div>

</div>

</body>

</html>

这个代码有些图片的地址,需要根据要求去改,这些是我自己写的,然后就是传输的文件,action那,接受的文件也是需要定义的。

1、按照正常的思路,布局就是div布局,写一个固定下来,作为模板,在每次获取数据的时候使用功能代码绑定数据到布局上面,自动生成页面内容就可以了。

拆分出单个模板来,很明显每项都是一样的

就这个样式写div+css不会吗?

两层div 的嵌套,里面布局排文本标签,image标签就可以了,绑定id填数据,或者遍历填数据。

简单布局是一种,再就是

这种