隨筆-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代碼
          主站蜘蛛池模板: 佳木斯市| 崇州市| 宝山区| 内黄县| 江安县| 黄梅县| 锡林郭勒盟| 五原县| 枝江市| 玛曲县| 石柱| 平潭县| 定日县| 威宁| 丰台区| 鹰潭市| 阳新县| 淮阳县| 易门县| 九龙县| 进贤县| 黄冈市| 滨海县| 抚远县| 扶风县| 南宁市| 芜湖县| 阜新市| 开阳县| 荔浦县| 南和县| 仁怀市| 马边| 南京市| 宜都市| 青川县| 会泽县| 尖扎县| 磐石市| 南阳市| 长寿区|