html,css積累

來源:互聯網
上載者:User
  1. html逸出字元
    &nbsp和TAB
    html裡的 是空格,但不是值為32(十六進位20).   的值是160(十六進位A0).
    HTML特殊字元不包括TAB. TAB應該也可以用&#9;表示. 但只有在<PRE>...</PRE>這樣的標記內部才起作用. 其他地方只相當於一個空格. 這和&nbsp;不一樣. 
    &amp; 或 &#38;相當於&符號
    &lt; 或 &#60; 相當於小於符號<
    &gt; 或 &#62;相當於大於符號>
    &quot; 相當於雙引號"
    &copy;相當於著作權符 |
    &reg;相當於註冊符
  2. 熱點
    就是在一個圖片上面,任意座標位置提供一個操作點.
    <img src="/images/page_images/index_lmenu.gif" width="329" height="28" border="0" usemap="#HashMap" >
    上面定義了一個圖片usemap="#HashMap",下面是在這個圖片上面定義4個熱點,他們是4個href操作的點,可以將href=""的屬性定義為一個url.
    <map name="HashMap">
        <area shape="rect" coords="39,7,88,20"  href="alert('ok')" style="cursor:'hand';"  target="main">
        <area shape="rect" coords="123,6,171,20" href="alert('ok')"  style="cursor:'hand';" target="main">
        <area shape="rect" coords="208,6,256,21" href="alert('ok')" style="cursor:'hand';" target="main">
        <area shape="rect" coords="289,7,318,21" href="alert('ok')"  style="cursor:'hand';" target="main">
    </map>
    如:
    <area shape="rect" coords="39,7,88,20"  href="alert('ok')" style="cursor:'hand';"  target="main">
    shape="rect"說明這個熱點是一個矩形,coords="39,7,88,20" 矩形熱點熱點在這個圖片上面的座標點.href="alert('ok')" 可以在這裡調用javascript函數,或者一個url串連.
  3. 相關編程網站
    http://www.webjx.com/ 網頁教學網http://www.webjx.com/plus/search.php?keyword=javascript+tree&channeltype=1&orderby=&kwtype=1&pagesize=15&typeid=0&TotalResult=91&PageNo=5
    http://qqqweb.net/jianzhan/57/106.htm meta文章
    http://www.wzsky.net 設計前沿
    http://phpx.com/man/dhtmlcn/objects/MARQUEE.html html參考
  4. document.execCommand()解析
    2D-Position;document.execCommand("2D-Position","false","true");使絕對位置的對象可直接拖動;ie5.5  
    AbsolutePosition;document.execCommand("AbsolutePosition","false","true");使對象定位變成絕對位置;ie5.5  
    BackColor;document.execCommand("BackColor","false",sColor);設定背景顏色;ie4.0  
    BlockDirLTR;none;使區塊層級元素排版方式為從左至右?;不支援  
    BlockDirRTL;none;使區塊層級元素排版方式為從右至左?;不支援   Bold;document.execCommand("Bold","false",null);使選中地區的文字加粗;ie4.0  
    BrowseMode;none;設定瀏覽器模式?;不支援   Copy;  
    document.execCommand("Copy","false",null);複製選中的文字到剪貼簿;ie4.0   CreateBookmark;document.execCommand("CreateBookmark","false",sAnchorName);設定指定錨點為書籤;ie4.0  
    CreateLink;document.execCommand("CreateLink","false",sLinkURL);將選中文本變成超串連,若第二個參數為true,會出現參數設定對話方塊;ie4.0  
    Cut;document.execCommand("Cut","false",null);剪貼選中的文字到剪貼簿;ie4.0  
    Delete;document.execCommand("Delete","false",null);刪除選中的文字;ie4.0  
    DirLTR;none;排版方式為從左至右?;不支援   DirRTL;none;排版方式為從右至左?;不支援  
    EditMode;none;設定編輯模式?;不支援  
    FontName;document.execCommand("FontName","false",sFontName);改變選中地區的字型;ie4.0  
    FontSize;document.execCommand("FontSize","false",sSize|iSize);改變選中地區的字型大小;ie4.0  
    ForeColor;document.execCommand("ForeColor","false",sColor);設定前景顏色;ie4.0  
    FormatBlock;document.execCommand("FormatBlock","false",sTagName);設定當前塊的標籤名;ie4.0
    <input type=button value=剪下 onclick=document.execCommand('Cut')>
    <input type=button value=拷貝 onclick=document.execCommand('Copy')>
    <input type=button value=粘貼 onclick=document.execCommand('Paste')>
    <input type=button value=撤消 onclick=document.execCommand('Undo')>
    <input type=button value=重做 onclick=document.execCommand('Redo') id=button2 name=button2>
    <input type=button value=刪除 onclick=document.execCommand('Delete')>
    <input type=button value=黑體 onclick=document.execCommand('Bold')>
    <input type=button value=斜體 onclick=document.execCommand('Italic')>
    <input type=button value=底線 onclick=document.execCommand('Underline')>
    <input type=button value=停止 onclick=document.execCommand('stop')>
    <input type=button value=儲存 onclick=document.execCommand('SaveAs')>
    <input type=button value=另存新檔 onclick=document.execCommand('Saveas',false,'c://test.htm')>
    <input type=button value=字型 onclick=document.execCommand('FontName',false,fn)>
    <input type=button value=字型大小 onclick=document.execCommand('FontSize',false,fs)>
    <input type=button value=重新整理 onclick=document.execCommand('refresh',false,0)>
  5. html中tbody標籤的作用 
    原來看見有的頁面中有<tbody>標籤,自以為是更好的規範<table>標籤的,錯了!
    每個表格可以有一個表頭、一個表尾和一個或多個表體,分別以THEAD、TFOOT和TBODY元素表示。
    用TBODY這個標籤可以控製表格分行下載,當表格內容很大時比較實用,在需要分行下載處(基於使用者心理吧)加上<tbody>和</tbody>,比如:
    <table>
       <tbody>
          <tr><td>表體1</td></tr>
          <tr><td>表體1</td></tr>
       </tbody>
       <tbody>
          <tr><td>表體2</td></tr>
          <tr><td>表體2</td></tr>
       </tbody>
    </table>
  6. 去除表格行間據
    在表格中田間屬性cellpadding="0" cellspacing="0";
    樣本:
    <table height="18" cellpadding="0" cellspacing="0">
         <tr height="18">
          <td width="18">&nbsp;</td>
          <td><img id="books" src="../imgs/plus2.gif"></td>
          <td><img id="books" src="../imgs/books_close.gif"></td>
          <td>Horror</td>
         </tr>
        </table>
  7. HTML中td元素的nowrap屬性
    HTML中td元素的nowrap屬性工作表示禁止儲存格中的文字自動換行。
    但使用時要注意的是,td元素中nowrap屬性的行為與td元素的width屬性有關。如果未設定td寬度,則nowrap屬性起作用的,如果設定了td寬度,則nowrap屬性不起作用。
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.