HTML语言简单回顾
简单复习一下html语言。html的基本结构如下:
<html> <head> <title></title> </head> <body> </body></html>
<marquee direction="left">会飞的文字</marquee>
<p>m<sub>2</sub></p> <p>m<sup>2</sup></p>
向控件定义标注(标记)。如果您在 label 元素内点击文本,就会触发此控件。就是说,当用户选择该标签时,浏览器就会自动将焦点转到和标签相关的表单控件上。譬如:
<label for="SSN">Social Security Number:</label> <input type="text" name="SocSecNum" id="SSN" /><label>Date of Birth: <input type="text" name="DofB" /></label>
<ul><li>Coffee</li><li>Milk</li></ul>
同样,有序列表也是一列项目,列表项目使用数字进行标记。
有序列表始于 <ol> 标签。每个列表项始于 <li> 标签。
<ol><li>Coffee</li><li>Milk</li></ol>
<table border = "1" width = "200px" cellspacing = "0" cellpadding = "2"><table border = "1" width = "200px" cellspacing = "0" cellpadding = "2"> <caption>表格标题</caption> <tr> <th colspan = "2">aa</th> </tr> <tr> <td>a1</td> <td>a2</td> </tr> </table>和并列:
<table border = "1" width = "200px" cellspacing = "0" cellpadding = "2"> <caption>表格标题</caption> <tr> <th rowspan = "2">aa</th> <th>bb</th> </tr> <tr> <td>a2</td> </tr> </table>
<img src="boat.gif" alt="Big Boat" >
<a name = "top">顶部</a>.....<a href = "#top">回到顶部</a>
<!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=gb2312" /><title>无标题文档</title><style type="text/css"> body,input,mainDiv{ margin : 0; padding:0; font-family:Georgia, "Times New Roman", Times, serif; font-weight:bold; } body{ margin:auto 250px;} .style{ border:2px solid black; }610071131208209 </style></head><body><div id="mainDiv"> <form action="http://127.0.0.1:10001" method="post"> <table border="1" cellspacing="0" bordercolor="#3300FF" width="700" height="400" cellpadding="2px"> <tr> <th colspan="2" >信息注册页面</th> </tr> <tr> <td>用户名</td> <td> <input type="text" name="user" class="style" /> </td> </tr> <tr> <td>密码</td> <td> <input type="password" name = "password" class="style" /> </td> </tr> <tr> <td>确定密码</td> <td> <input type="password" name = "confirmpwd" class="style" /> </td> </tr> <tr> <td>性别</td> <td> <input type="radio" name="sex" value="man" />男 <input type="radio" name="sex" value="woman"/>女 </td> </tr> <tr> <td>技术</td> <td> <input type="checkbox" name="tec" value="java"/>java <input type="checkbox" name="tec" value="jsp"/>jsp <input type="checkbox" name="tec" value="servlet"/>servlet </td> </tr> <tr> <td>国家</td> <td> <select name="country"> <option value="none">---选择国家---</option> <option value="China">中国</option> <option value="America">美国</option> <option value="Japan">日本</option> </select> </td> </tr> <tr > <td colspan="2" align="center"> <input type="submit" value="提交数据" /> <input type="reset" value="清除数据" /> </td> </tr> </table> </form> </div></body></html>
import java.io.BufferedInputStream;import java.io.IOException;import java.io.PrintWriter;import java.net.ServerSocket;import java.net.Socket;public class Server{ public static void main(String[] args) throws IOException { ServerSocket ss = new ServerSocket(10001); Socket s = ss.accept(); PrintWriter pw = new PrintWriter(s.getOutputStream(), true ); pw.println( "<font color = red size = 20px>注册</font>" ); //往服务端发数据 BufferedInputStream bufi = new BufferedInputStream(s.getInputStream()); //接收数据 byte [] buff = new byte [1024]; int len = bufi.read(buff); System. out .println( new String(buff,0,len)); s.close(); ss.close(); } }