欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  代码如下:
 
  CssMark.html
 
  
 
  <!DOCTYPEhtml>
 
  <html>
 
  <head>
 
  <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
 
  <title></title>
 
  <linkrel="stylesheet"type="text/css"href="CssMark.css"/>
 
  </head>
 
  <body>
 
  <divclass="TriMarkPre0"></div>
 
  <br/>
 
  <divclass="TriMarkPre1"></div>
 
  <br/>
 
  <divclass="TriMarkPre2"></div>
 
  <br/>
 
  <divclass="TriMark"></div>
 
  </body>
 
  </html>
 
  CssMark.css
 
  
 
  .TriMarkPre0{
 
  position:static;
 
  width:100px;
 
  height:100px;
 
  border:10pxsolidtransparent;
 
  border-color:#0058e2;
 
  }
 
  .TriMarkPre1{
 
  position:static;
 
  width:100px;
 
  height:100px;
 
  border:10pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }
 
  .TriMarkPre2{
 
  position:static;
 
  width:0px;
 
  height:0px;
 
  border:10pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }
 
  .TriMark{
 
  position:static;
 
  width:0px;
 
  height:0px;
 
  border:5pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }
 
  代码详解
 
  创建流程1:
 
  下面的代码是绘制100x100像素区域的外框的代码。这是一般代码。
 
  执行结果图像顶部的方框对应于该代码。
 
  <divclass="TriMarkPre0"></div>
 
  .TriMarkPre0{
 
  position:static;
 
  width:100px;
 
  height:100px;
 
  border:10pxsolidtransparent;
 
  border-color:#0058e2;
 
  }
 
  创建过程2:
 
  使用下面的代码,仅绘制区域框架的左侧。如果您绘制左侧,您可以看到拐角部分是对角切割的。(当绘制4个边时,只绘制一半以使每条线不重叠。)
 
  此代码对应于将执行结果图像的第二个梯形向侧面的代码。
 
  <divclass="TriMarkPre1"></div>
 
  .TriMarkPre1{
 
  position:static;
 
  width:100px;
 
  height:100px;
 
  border:10pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }
 
  完成:
 
  可以使用以下代码绘制三角形标记。
 
  通过减小前一行左侧代码的高度,行之间的部分将消失,它将显示为三角形标记。
 
  执行结果图像的第三个图对应于该代码。
 
  <divclass="TriMarkPre2"></div>
 
  .TriMarkPre2{
 
  position:static;
 
  width:0px;
 
  height:0px;
 
  border:10pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }
 
  您可以通过减小线的边框宽度来更改三角形标记的大小。
 
  执行结果图像的第四个图对应于该代码。
 
  <divclass="TriMark"></div>
 
  .TriMark{
 
  position:static;
 
  width:0px;
 
  height:0px;
 
  border:5pxsolidtransparent;
 
  border-left-color:#0058e2;
 
  }






本文转载自中文网

 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56615.shtml