html – 如何使用CSS制作图像3D

我在html表的帮助下绘制棋盘现在我想在这里制作3D是我的CSS和HTML.

table {
  margin: 0 auto;
  border-collapse: collapse;
  background: black;
}
td {
  width: 60px; height: 60px;
}
tr:nth-child(odd) td:nth-child(even),tr:nth-child(even) td:nth-child(odd) {
  background: white;
  width: 59px;
  height: 50px;
}
display:inline-block;border-style:double">
  

目前的结果:

enter image description here

想要它像:

enter image description here

最佳答案
如果你想要它看起来更像3D,你可以从@haxxxton获取代码并在底部添加一个div,如下所示.

table {
	margin: 0 auto;
	border-collapse: collapse;
	background: black;
	border:2px double black;
}
td {
	width: 60px; height: 60px;
}
tr:nth-child(odd) td:nth-child(even),tr:nth-child(even) td:nth-child(odd) {
	background: white;
	width: 59px;
	height: 59px;
}
.parent {
	margin:0 auto;
	height:488px;
	width:460px;
	perspective-origin: 50% 50%;
	perspective: 1000px;
}
.child {
	transform: rotateX(60deg);
}
#div3 { 
  position: relative;
    height: 10px;
    width: 616px;
    margin-left:-61px;
    margin-top:-90px;
    background-color: brown;
    border: 1px solid black;
  }

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效