隨筆 - 28, 文章 - 0, 評論 - 3, 引用 - 0
          數據加載中……

          學習中的點滴

          記錄學習,工作中遇到的點點滴滴的問題。
          1、需要把 background-attachment 屬性設置為 "fixed",才能保證該屬性在 Firefox 和 Opera 中正常工作。
          例子:

          <html>
            <head>
            <style type="text/css">
             body
             {
               background-image:url('eg_bg_03.gif');
               background-repeat:no-repeat;
               background-position:center;
               background-attachment:fixed;
             }
            </style>
            </head>
            <body>

            </body>
          </html>

          2、

          clear:both

           CSS中 clear:both;可以終結在出現他之前的浮動
            

          語法: clear : none | left |right | both


          參數:

          none : 允許兩邊都可以有浮動對象

          both : 不允許有浮動對象

          left : 不允許左邊有浮動對象

          right : 不允許右邊有浮動對象


          說明: 該屬性的值指出了不允許有浮動對象的邊。請參閱float屬性。 對應的腳本特性為clear


          示例:

          div { clear : left }

          img { float: right }

          <div style="clear:both;"></div>

          主要是用在div套div的結構中。如果內div是浮動的,一般都需要clear浮動,不然的話內div會超出外div的框架

          所用什么時候用clear:both;就很重要,一般我們在需要清除浮動的時候用到clear:both;不要輕意用到clear:both;因為它也有副伯用.

          我們寫一個clear:both;的例子:

          <div style="float:left;width:100px;"> clear:both第1行第1列,</div>
          <div style="float:left;width:700px;"> clear:both第1行第2列,</div>
          <div style="clear:both;"> clear:both第2行。</div>


          <div style="float:left;width:100px;"> 第1列,</div>
          <div style="float:left;width:700px;"> 第2列,</div>
          <div>第三列</div>
          ------------------------------------------------------------------------------------------------
          <div style="float:left;width:100px;"> 第1列,</div>
          <div style="float:left;width:700px;"> 第2列,</div>
          <div style="clear:both;"></div>
          <div>第三列</div>


          3css疑難問題收集
          表格與內聯對象不換行:
          table{
          width:30em; 
          table-layout:fixed;/* 只有定義了表格的布局算法為fixed,下面td的定義才能起作用。 */ 
          td{ 
          width:100%; 
          word-break:keep-all;/* 不換行 */ 
          white-space:nowrap;/* 不換行 */ 
          overflow:hidden;/* 內容超出寬度時隱藏超出部分的內容 */ 
          text-overflow:ellipsis;/* 當對象內文本溢出時顯示省略標記(...) ;需與overflow:hidden;一起使用。*/ 

          .text-overflow { 
          display:block;/*內聯對象需加*/ 
          width:31em; 
          word-break:keep-all;/* 不換行 */ 
          white-space:nowrap;/* 不換行 */ 
          overflow:hidden;/* 內容超出寬度時隱藏超出部分的內容 */ 
          text-overflow:ellipsis;/* 當對象內文本溢出時顯示省略標記(...) ;需與overflow:hidden;一起使用。*/ 
          }

          posted on 2010-03-11 10:46 Angle Wang 閱讀(254) 評論(0)  編輯  收藏 所屬分類: CSS

          主站蜘蛛池模板: 乃东县| 灵宝市| 海口市| 石城县| 肥城市| 虎林市| 平罗县| 南乐县| 额敏县| 康平县| 康乐县| 根河市| 砚山县| 江源县| 万安县| 汶川县| 清涧县| 英吉沙县| 吴堡县| 中卫市| 牙克石市| 白山市| 奉新县| 阜新| 彩票| 蒲江县| 桃源县| 上高县| 巩留县| 同心县| 明水县| 太原市| 左贡县| 大余县| 江孜县| 九龙城区| 嵩明县| 彩票| 清流县| 衡阳县| 定兴县|