国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

Html輕松實現圓角矩形

2019-10-26 17:27:17
字體:
來源:轉載
供稿:網友

問題:如何通過div+css以及定位來實現圓角矩形?
 
解決方法概述:
 
內容:首先在<body>標簽內部里添加一個大層(大層用來固定整體大框架),然后大層內包含四個小層(四個小層里分別放四個圓角(事先用ps做好橢圓形形狀,然后用切片工具切圖 ))
 
樣式:在<head>標簽內部設置的css要有的屬性:
 
1.position:relative;
 
2.寬和高;
 
3背景顏色;
 
4.邊框線(用來調整四個原角的相對位置,調整好后可以將邊框線設置刪除)
 
在設置小層的css時,每個層里都要有的屬性有:
 
1.position:absolute;
 
2.寬和高;
 
3.方向屬性(left,right,bottom,top)
 
4.background:url("")no-repeat;(引入各個方向的圓角圖片)
 
以下是我實現圓角矩形的代碼:

  • <!doctype html>     
  • <html lang="en">       
  •  <head>     
  •   <meta charset="UTF-8">     
  •   <meta name="Generator" content="EditPlus®">     
  •   <meta name="Author" content="">     
  •   <meta name="Keywords" content="">     
  •   <meta name="Description" content="">     
  •   <title>圓角制作</title>     
  •   <style type=text/css>     
  •   #p      
  •        
  •   {      
  •   position:relative;      
  •   width:400px;      
  •   height:200px;      
  •   background:black;      
  •   margin:auto;      
  •   }      
  •   #plefttop      
  •   {       
  •   position:absolute;      
  •   width:50px;      
  •   height:50px;       
  •  background:url("images/11.jpg") no-repeat;      
  •   }      
  •    #prighttop       
  •   {      
  •   position:absolute;      
  •   width:50px;      
  •   height:50px;      
  •   right:-9px;      
  •   top:0px;       
  •   background:url("images/22.jpg")  no-repeat;      
  •   }      
  •    #pleftbottom      
  •   {      
  •   position:absolute;      
  •   width:50px;      
  •   height:50px;      
  •   left:0px;      
  •   bottom:-14px;      
  •   background:url("images/33.jpg") no-repeat;      
  •   }      
  •   #prightbottom      
  •   {      
  •    position:absolute;      
  •   width:50px;      
  •   height:50px;      
  •   right:-9px;      
  •   bottom:-14px;      
  •   background:url("images/44.jpg") no-repeat;      
  •   }      
  •   </style>     
  •  </head>     
  •  <body>     
  • <div id=p>     
  • <div id=plefttop></div>     
  • <div id=prighttop></div>     
  • <div id=pleftbottom></div>     
  • <div id=prightbottom></div>     
  • </div>     
  • </body>     
  • </html>       
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 南投市| 亳州市| 当雄县| 青河县| 安陆市| 岑溪市| 平原县| 南召县| 香港| 陈巴尔虎旗| 咸宁市| 甘孜| 苍溪县| 嘉峪关市| 蒙阴县| 甘洛县| 法库县| 海阳市| 全南县| 杂多县| 舒城县| 黔西县| 枣阳市| 克什克腾旗| 鄂尔多斯市| 金昌市| 漯河市| 海伦市| 区。| 隆德县| 四子王旗| 江永县| 名山县| 察雅县| 化德县| 谢通门县| 新津县| 华阴市| 桃园市| 宜春市| 武宣县|