Html学习

一直没把它当回事,决定恶补一下.

html多裁到多余的空格,几个空格在一起只当一个

一:元素用小写
1.<hr> 水平线
2.<p></p>段落
3.<h1></h1>字体大小可到<h6></h6>  1最大
4.<sup></sup>浮于半行上
        This text contains subscript
5.<sub></sub>沉于半行下  
       This text contains superscript
6.<pre></pre>预格式化文本  
       <pre>
            This is 
            preformatted text.
            It preserves      both spaces 
            and line breaks.
        </pre>行尾不需加<br>也会按此格式显示
7.<bdo dir="rtl"> </bdo>   将文字按字母为单位倒显示
    示例:
    <bdo dir="rtl">
    Here is some Hebrew text
    </bdo>
     结果: Here is some Hebrew text


二:属性小写
bgcolor背景色

三:HTML实体
1。字符实体(部份字符含有特殊含议不能显示)
     字符实体包括三个部份:  and符号&,一个实体名,一个分号结尾  ; 
        <  可用&lt; 或 &#60;  表示。
四:链接
  <a>  锚标签  href属性  name 属性

 <a href="" target="_blank"></a>    target表示打开新窗体的位置 ,"_blank"表示在新窗体中打开

  链接到本页面某些文字
  <a name="comethere">if you click ,you'll come here</a>
  <a href="#comethere">Click And Go</a>

 创建邮件链接<a href="mailto:loverchina2008@gmail.com?subject=Hello%20how%20are%20you">给我发邮件</a>
                        subject为主题,空格用%20表示

<a href="mailto:someone@microsoft.com?cc=someoneelse@microsoft.com&bcc=andsomeoneelse2@microsoft.com&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!">Send mail!</a>
cc为抄送,bcc为密送,subject为主题,body为正文.


  尽量在子目录路径后面加一个左斜杠。假如你像下面这样写:href="http://www.w3schools.com/html",将会产生向服务器产生两个HTTP请求,因为服务器会在后面追加一个左斜杠,产生一个新的请求,就像这样:href="http://www.w3schools.com/html/"。

五:HTML框架
<html>
<frameset rows="50%,50%">     //横着分
 <frame noresize="noresize" src="frame_a.htm">
 <frameset cols="25%,75%">     //竖着分
  <frame noresize="noresize" src="frame_b.htm">  //noresize="noresize"表示大小可以调整
  <frame noresize="noresize" src="frame_c.htm#abc">  //跳到指定章节 在frame_c.htm中用<a name="abc">ddddddd</a>指定
</frameset>
</html>

导航框架  <frame name=""> 在打开的页面语句指定target= frame的name,则指定在此frame中打开页面
内联框架 既将框架的定义放在<body></body>标签对中

<html>
<frameset cols="200,*">
 <frame src="frame_linksection.htm">
 <frame src="frame_section.htm" name="showframe">
</frameset>
</html>     在frame_linksection.htm中指定链接,将目标定为右边的frame
                   在frame_linksection.htm中的页面中<a href="*.html" target="showframe">goto</a>



表格
<table>  <tr>行   <td>列  <th>表格头  colspan 跨列属性  cellpadding  表格内容和边框之间留出更多空白。
<bgcolor> 背景色  <background> 背景图片  align对齐属性
<ul>
 <li>apples</li>
 <li>bananas</li>
 <li>pineapples</li>
 </ul>    在apples等前用黑点标记 自动分行



列表
1.无序列表
<ul type="">  type="disc"用实心圆表示   type="circle"用空心圆表示  type="square"用实心正方形表示
<ul>
    <li></li>
</ul>
2.有序列表,前面用符号标注
在<ol>标签内 type属性表示不同的符号  A 用大写字母表示从A开始到结束字符  ;a用小字;默认为数字
type="i"则用 i    ii  iii    iv表示   ;type="I"则用  I    II   III   IV表示
<ol>
   <li></li>
</ol>
3.自定义列表 ,以<dl>开始,<dt>为标题,<dd>显示注释信息
<dl>
    <dt>aaa</dt>
    <dd>this is aaa</dd>
</dl>


表单:
1.<input type="">  text文本  ; password密码; button按钮;  radio单选 ,放在同一个form里就自动成组;  checkbox复选.

2.<input type="radio" name="" value="">
action属性定义了表单要提交到的页面
<form name="input" action="html_form_action.asp" method="get">
Username:
<input type="text" name="user">
<input type="submit" value="Submit">
</form>   点周按钮时会将文本框的值提交给html_form_action.asp页面

3.<select name ="">   下拉列表
       <select value="aaa">fdfd
       <select value="bbb" selected>dfdf  预选值
   </select>

  多行文本
   <textarea rows="10" cols="30">
        The cat was playing in the garden.
    </textarea>
  
  控件组
  <fieldset>
        <legend>
            这里是组标题
       </legend>
        <form>
                这里放要放在组里的控件
                <input type="radio" name ="a" value="jorlin">
                <input type="radio" name ="b" value="thinking_pro">
        </form>
 </fieldset>

效果如下
这里是组标题
这里放要放在组里的控件


从表单发送电子邮件
<html>
<body>
<form action="MAILTO:someone@w3schools.com" method="post" enctype="text/plain">
<h3>This form sends an e-mail to W3Schools.</h3>
Name:<br>
<input type="text" name="name" value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail" value="yourmail" size="20">
<br>
Comment:<br>
<input type="text" name="comment" value="yourcomment" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html> 效果如下:

This form sends an e-mail to W3Schools.

Name:

Mail:

Comment:

图像
<img>属于空标签,意思是只有属性而没有结束标签。
src图片路径, alt鼠标移到图片上时显示的文本
<body background="背景图像路径">
<a href="">
    <img src="" alt="" ismap>
</a>     //在图像作为超级链接中,如果加了ismap属性,则鼠标在图像上移动时状态栏上会显示鼠标焦点坐标
图像地图
<img src="./images/planets.gif" width="145" height="126" usemap="#planetmap">
<map id="planetmap" name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercury.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>

<body bgcolor="" text="yellow">  text定义文字顔色

<body>标签的bgcolor、background和text属性在最新的HTML标准(HTML4和XHTML)中已被废弃。W3C在他们的推荐中已删除这些属性。在HTML的未来版本中,层叠样式表(CSS)将被用来定义HTML元素的布局和显示属性。


一本书到些结束,对html有了大概的了解,希望今天看完一本Dhtml教程,看完后就可以开始javascript了。

posted on 2005-11-18 13:35  泽来  阅读(505)  评论(0编辑  收藏  举报