html,css积累

来源:互联网 发布:丰城网络问政有用吗 编辑:程序博客网 时间:2024/04/30 08:25
  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属性不起作用。
原创粉丝点击