隨筆-9  評論-168  文章-266  trackbacks-0

          <html>
          <head>
          <style>
          #a{
          border-left:1px #333 solid;
          border-right:1px #333 solid;
          width:300px;
          height:500px;
          }
          .b{
          height:1px;
          overflow:hidden;        /* 兼容IE,因為IE指定任何元素最小高度都為19px,不可更改。*/
          border-left:1px #333 solid;
          border-right:1px #333 solid;
          }
          </style>
          </head>
          <body>
          <div>
          <div class="b" style="margin-left:3px;width:294px;background:#333"></div>
          <div class="b" style="margin-left:2px;width:296px;"></div>
          <div class="b" style="margin-left:1px;width:298px"></div>
          <div id="a">

          代碼很簡單,a層為內容層,其width值300,然后用b層向外以左右邊框2像素(可任意)的寬度遞減。最外一層要加上background屬性,目的是要將上、下兩線條呈現出來;b層的數量決定了要實現的圓角弧度大小。在firefox IE6 都通過測試。

          </div>
          <div class="b" style="margin-left:1px;width:298px"></div>
          <div class="b" style="margin-left:2px;width:296px;"></div>
          <div class="b" style="margin-left:3px;width:294px;background:#333"></div>
          </div>
          </body>
          </html>

          posted on 2009-10-15 10:51 紫蝶∏飛揚↗ 閱讀(462) 評論(0)  編輯  收藏 所屬分類: CSSdiv+css+js代碼
          主站蜘蛛池模板: 盐山县| 广安市| 大名县| 夏邑县| 临泽县| 黎川县| 正宁县| 双牌县| 周至县| 报价| 肇州县| 巩留县| 米林县| 满城县| 云林县| 平遥县| 彩票| 久治县| 灵石县| 昭苏县| 龙川县| 五河县| 临泽县| 鄢陵县| 桐庐县| 镇安县| 石狮市| 保山市| 民县| 稷山县| 远安县| 旬邑县| 晋中市| 新余市| 滦南县| 延寿县| 宁国市| 平远县| 海晏县| 大姚县| 沙湾县|