圆角矩形

来源:互联网 发布:云南投资公司知乎 编辑:程序博客网 时间:2024/04/29 07:16

corners

用一个图片就可以做出圆角div, 看代码!

  1. <style>
  2.     .tb{
  3.         width: 181px; 
  4.         background: #8cc355 url(bottom.gif) no-repeat left bottom;
  5.     }
  6.     .tb h1{
  7.         padding: 10px 10px 0px 10px;
  8.         background: #8cc355 url(top.gif) no-repeat left top;
  9.     }
  10.     .tb p{
  11.         padding: 0px 10px 10px 10px;
  12.     }
  13.     a,a:active, a:link, a:hover, avisited{
  14.         font-size:14px;
  15.         font-weight: bold;
  16.         color: blue;
  17.         text-decoration: none;
  18.     }
  19.     a:hover{
  20.         font-size:14px;
  21.         font-weight: bold;
  22.         color: red;
  23.         text-decoration: underline;
  24.     }
  25.     #corner {
  26.         width: 220px;
  27.     }
  28.     #corner .top{
  29.         height: 10px;
  30.         overflow: hidden;
  31.     }
  32.     #corner .top .top-left{
  33.         width: 10px;
  34.         float: left;
  35.         background: url(corners.gif) no repeat left top;
  36.         
  37.     }
  38.     #corner .top .top-center{
  39.         border-top: solid #8CB4D0 1px;
  40.         width: 200px;
  41.         float: left;
  42.     }
  43.     #corner .top .top-right{
  44.         width: 10px;
  45.         float: left;
  46.         background: url(corners.gif) no-repeat right top;
  47.     }
  48.     .bottom{
  49.         height: 10px;
  50.         overflow: hidden;
  51.     }
  52.     .bottom-left{
  53.         width: 10px;
  54.         float: left;
  55.         background: url(corners.gif) no repeat;
  56.         background-position: 0 -10px;
  57.     }
  58.     .bottom-center{
  59.         border-bottom: solid #8CB4D0 1px;
  60.         width: 200px;
  61.         height: 10px;
  62.         overflow: hidden;
  63.         float: left;
  64.     }
  65.     .bottom-right{
  66.         width: 10px;
  67.         float: left;
  68.         background: url(corners.gif) no-repeat;
  69.         background-position: -10px -10px;
  70.     }
  71.     .content{
  72.         border-left: solid #8CB4D0 1px;
  73.         border-right: solid #8CB4D0 1px;
  74.         padding: 0px 10px;
  75.     }
  76. </style>
  77. <div class="tb">
  78.     <h1><a href="#">TITLE</a></h1>
  79.     <p>THIS THE CONTENT</p>
  80. </div>
  81. <br>
  82. <div style="height: 5px; width: 50px; border: solid red 1px; overflow: hidden"></div>
  83. <br>
  84. <div id="corner">
  85.     <div class="top">
  86.         <div class="top-left"></div>
  87.         <div class="top-center"></div>
  88.         <div class="top-right"></div>
  89.     </div>
  90.     <div class="content">this is the content
  91.     <br>this is the contentthis is the contentthis is the contentthis is the contentthis is the content</div>
  92.     <div class="bottom">
  93.         <div class="bottom-left"></div>
  94.         <div class="bottom-center"></div>
  95.         <div class="bottom-right"></div>
  96.     </div>
  97. </div>

=============================================

/**JS画图,JS小游戏,JS代码集合, JS地图,JS写RPG游戏,JS动画,JS绘图, JS对象, JS函数, JS经典 例子,JS面向对象, javascript画图,javascript小游戏,javascript代码集合, javascript地图,javascript写RPG游戏,javascript动画,javascript绘图, javascript对象, javascript函数, javascript经典例子,javascript面向对象,css网站,css资源,css代码,css学习,css下载,css教程,css分享**/

原创粉丝点击