在html、jsp中经常用到table,但在table中如何实现标题表格中画斜线的操作呢?从网上查了很多资料,可以实现的方法有好几种,现在提供一种简单的操作方法,而且不用考虑分辨率的问题,如图:
方法如下:
该方法,实现的不是纯粹的在table中画斜线,而是实现两种颜色的对比,实现出有斜线的感觉:
<!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>Document</title>
<style>
/*对角钱矩形宽度为50,高度为100,分别对应border-top和border-left两个属性来设定*/
.d1{border-top:100px threedlightshadow solid;border-left:120px windowframe solid;width:0;height:0;position:relative;color:#FFF}
span{display:block;width:40px}
.s1{position:absolute;top:-70px;left:-44px;color:black;}
.s2{position:absolute;bottom:8px;right:55px}
</style>
</head>
<body>
<div class="d1">
<span class="s1">专业</span>
<span class="s2">项目</span>
</div>
</body>
</html>
参考:http://share.iteye.com/blog/1670054