zoukankan      html  css  js  c++  java
  • html.day02

    1.链接标签  a

    <a href=”http://www.baidu.com”></a>
    <img src=”aaa”/>  

      一般情况下:  来源  用 src     去往 用 href 

      背景音乐

    <bgsound src=”xx.mp3”/>
    

      1.链接的分类 

        链接可以分很多类。有以下几个

        1.内部链接

          主要用于站点内部文件的相互链接。

           <a>链接</a>

        2.外部链接

          主要用于网络上的链接   格式要求 必须以 : http:// 开头

          例如: <a href=”http://www.baidu.com”>百度</a>

        3.锚点链接      

          同一个页面的锚点链接  :

          2步走:

              1. 先抛锚 :把光标定位到要去往的地方,然后插入命名锚记,取好名称。

              代码如下:

    <p>5家族成员编辑<a name="home" id="home"></a></p>

              2. 选择要点击的对象,在链接里面输入:    #+锚记名称  就可以了。

          不同页面 的锚点链接

            第一步 一样

            第二步 几乎一样  不同的地方在于: 

            选择要点击的对象,在链接里面输入: 文件名称+#+锚记名称  就可以了

    <a href="04 test.html#chang">长乐公主</a>
    

        4.空链接#

    <a href=”#”>三角</a>
    

        5.JavaScript 链接

    <a href=”javascript:void(0)”></a>   js 空链接
    

      

      关于链接的2个小地方:

      1. 链接目标 

        target  链接目标

        _blank  新窗口中打开链接 

        _self   当前窗口中打开  (默认的)

        _parent  在父窗口中打开 

        _top   在顶窗口中打开       

        例如: 在新窗口中打开页面的方法是:

    <a href=”http://www.baidu.com” target=”_blank”> 百度 </a>
    

      2. nofollow   seo 优化常用

        rel=”nofollow”  就是让搜索引擎 不去爬这个链接

        百度蜘蛛

        作用: 就是一些不重要的链接 ,不让搜索引擎去爬链接。

        网站后台   用户信息  

    2.列表 

      在合适的地方用合适的标签

      css+div      div越少越好  span  权重很低  

      span  div  ul   dl   table

      列表分三类:

      1.无序列表  (ul

    <ul>
        <li></li>
        <li></li> 
        <li></li>
    </ul>

      type  类型  

      disc  实心圆  circle  空心圆  square  方块

    <ul type="square">
        <li>苹果</li>
        <li>橘子</li>
        <li>香蕉</li>
    </ul>
    

      2.有序列表  (ol

    <ol>
        <li></li>
        <li></li>
        <li></li>
    </ol>
    

      3.自定义列表  (dl

    <dl>
        <dt></dt>  定义标题
        <dd></dd> 定义内容(主要对标题进行描述)
    </dl>
    

    3.表格  table 

    标签

    作用

    <table>    </table> 

    表格

    <tr>   </tr>

    <td>  </td>

    单元格

    <th>   </th>

    表头(行标题)

      th  会让里面的文字 加粗  并且居中

      bordercolor   边框颜色  

      cellspacing   间距 : 单元格和单元格之间的距离

      cellpadding   边距: 单元格内部内容和单元格边的距离

      一般下:三参为0

      border  cellspacing   cellpadding  都是0

      我们已知  :  align  水平居中

      垂直居中  : valign :  top()   bottom(下)   middle(居中)

      1.细线表格  

        1. css  来做

        2.巧妙运用 间距来做。

          1. 先给大表格指定背景色 (红色)

          2. 然后给行指定背景色(白色)

          3. 最后给表格指定间距就ok了。

      dw快捷键:

    快键键

    作用

    ctrl+alt+i   

    插入图片

    ctrl+alt+t

    插入表格

    ctrl+alt+f

    插入flash

    4.表单 form  

      表单 : 收集用户信息 , 表单 和用户进行交互 

      1.文本框 表单

      input  输入的  必须写的 是 type   text  文本的意思  所以是文本框

    <input type=”text”/>
    用户名:<input type="text" name="username"  />

      2.密码框

    <input type=”password” name=’pwd’/>
    密 码:<input type="password" name="pwd" />
    

      3.单选按钮

    <input type=”radio” name=”sex”>
    

      注意: 此时,name必须写  而且不管几个单选按钮,name必须一样(一组内)

      4.复选框按钮

      跟radio一样  还有就是 checked=“checked”

    <input type=”checkbox” name=”know”>
    <input type="checkbox"  name="know" checked="checked"/>   默认选中
    

      5.下拉列表

    <select name=”jg”>
        <option> 北京</option>
        <option> 上海</option>
        <option> 天津</option>
    </select>

      默认选中某一个 : selected=“selected”  注意和单选复选不一样

      案例如下:  

    <select name='jg'>
    	<option>北京</option>
    	<option>上海</option>
    	<option>天津</option>
    	<option selected="selected">山东</option>
    </select>
    

      6.提交按钮

    <input type=”submit” value=”点击提交”>

      value 控制按钮 上的文字

      7.重置按钮

    <input type=”reset” value=”再写一次”>
    

      value 控制按钮 上的文字

      8.文本域

    <textarea>     </textarea>

      rows  行数

      cols   列数

      9.普通按钮

    <button>    </button>
    

      10.图片按钮

    <input type=”image”  src=”xx.jpg”/>
    

    转载请注明出处

     

  • 相关阅读:
    【2017 Multi-University Training Contest
    【2017 Multi-University Training Contest
    【Uva 1543】Telescope
    Information centric network (icn) node based on switch and network process using the node
    JQuery实现放大镜
    JQuery实现放大镜
    JS关闭浏览器 (不弹出提示框)
    JS关闭浏览器 (不弹出提示框)
    JS关闭浏览器 (不弹出提示框)
    MVC5 Controller构造方法获取User为空解决方法
  • 原文地址:https://www.cnblogs.com/brittany/p/4784189.html
Copyright © 2011-2022 走看看