posts - 108,comments - 56,trackbacks - 0
               ☆下拉列表填加/刪除選項
            document.getElementById("selectId").options.add(new Option("text","value")); 
            document.getElementById(
          "selectId").options[i]=null;


               ☆固定表格的寬度,不要被文字撐寬
            如果是table:style=" table-layout:fixed;word-wrap:break-word;"
            如果是div:style
          ="word-wrap:break-word;"


               ☆只顯示豎向滾動條
            overflow-x:none;overflow-y:scroll;


               ☆表格內(nèi)文本超出指定寬度溢出的處理(顯示為……)
          table{
             width
          :600px;
             table-layout
          :fixed;/*只有定義了表格的布局算法為fixed,下面td的定義才能起作用。 */
          }
          td
          {
             word-break
          :keep-all;/* 不換行 */
             white-space
          :nowrap;/* 不換行 */
             overflow
          :hidden;/* 內(nèi)容超出寬度時隱藏超出部分的內(nèi)容 */
             text-overflow
          :ellipsis;/* 當(dāng)對象內(nèi)文本溢出時顯示省略標(biāo)記() ;需與overflow:hidden;一起使用。*/
          }


               ☆設(shè)置disabled
             不可用:"disabled":disabled="disabled"
             可用:false;(注意不要加引號):disabled=false;
             注意:如果設(shè)置為disabled后,在Form提交后是讀不到值的。例如:<input type="text" name="user" value="myname" disabled="disabled"/>, 雖然組件"user"有值(value="myname"),但是提交過后是讀不出值的。即取得"user"的值為空。


               ☆捕獲回車事件
          <script type="text/javascript" >
              
          if(document.addEventListener)
                  document.addEventListener(
          "keydown",myKeyDown,true);//IE
              else
                  document.attachEvent(
          "onkeydown",myKeyDown);//FireFox

              
          function myKeyDown(event){
                  
          if(event.keyCode==13)
                      alert(
          "enter");
              }
          </script>


               ☆表格邊框為虛線
            style="border-collapse: collapse;border: 1px dotted #afafaf;"
                 【none:無樣式;  
              dotted:點線;  
              dashed:虛線;  
              solid:實線;  
              double:雙線;  
              groove:槽線;  
              ridge:脊線;  
              inset:內(nèi)凹;  
              outset:外凸。】


               ☆滾動字幕
            <marquee 
            direction="up" //滾動方向
            bgcolor="#99CC33"  //背景顏色
            loop="-1" //無限循環(huán)
            scrollamount="3" //滾動速度
            scrolldelay="200"  //滾動停留
            height="60px" //高度
            hspace="2"  //左右距離
            vspace="5"  //上下距離
            onmouseover="this.stop()"  //停止?jié)L動
            onmouseout="this.start()">
            </marquee>


               ☆使插入表格中的表格往上對齊
            在外面的td中加入屬性valign="top"


               ☆Line-height無效
            如果在單元格里面即有圖片,同時又有文字,那么設(shè)置line-height無效;解決方法:1)設(shè)置圖片的margin距離;
          2)用css:
            ul {list-style-image:url(../images/arrow1.gif);}
            li{line-height:180%;list-style:none;margin-left:20px;}
          posted on 2007-08-29 16:54 破繭而出 閱讀(511) 評論(0)  編輯  收藏 所屬分類: CSS_DOM

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 弥渡县| 禹州市| 永福县| 景宁| 福泉市| 惠州市| 房产| 内黄县| 怀来县| 肃南| 佛教| 米泉市| 沐川县| 赤壁市| 龙川县| 黑水县| 新龙县| 漳平市| 阿荣旗| 永平县| 江永县| 桦南县| 八宿县| 高州市| 辽阳市| 腾冲县| 阜阳市| 德昌县| 富裕县| 孝感市| 车致| 华安县| 吴川市| 囊谦县| 交城县| 平邑县| 赤水市| 怀集县| 彭山县| 宜都市| 丰城市|