我正试图为我的下一个项目制作一个带有画布的电子电阻图像。 现在我给了它一个电阻形状,但我无法删除边距。如何摆脱HTML Canvas元素的边距?
我试着将填充和边距设置为值0px。但似乎没有工作。
我的HTML/CSS代码:
.canvas-wire {
border: 1px solid #a09898;
background-color: #a09898;
vertical-align: middle;
margin: 0;
padding: 0;
}
.canvas-film-1 {
border-radius: 8px 0px 0px 8px;
background: linear-gradient(#FFEB3B, #FF9800);
vertical-align: middle;
margin: 0;
padding: 0;
}
.canvas-film-2 {
border-radius: 0px 8px 8px 0px;
background: linear-gradient(#FFEB3B, #FF9800);
vertical-align: middle;
margin: 0;
padding: 0;
}
.canvas-film-mid {
background: linear-gradient(#FFEB3B, #FF9800);
vertical-align: middle;
margin: 0;
padding: 0;
}
.metal {
position: relative;
text-shadow: hsla(0, 0%, 40%, .5) 0 -1px 0, hsla(0, 0%, 100%, .6) 0 2px 1px;
background-color: hsl(0, 0%, 90%);
margin: 0;
padding: 0;
}
.metal.linear {
background-image: -webkit-repeating-linear-gradient(left, hsla(0, 0%, 100%, 0) 0%, hsla(0, 0%, 100%, 0) 6%, hsla(0, 0%, 100%, .1) 7.5%), -webkit-repeating-linear-gradient(left, hsla(0, 0%, 0%, 0) 0%, hsla(0, 0%, 0%, 0) 4%, hsla(0, 0%, 0%, .03) 4.5%), -webkit-repeating-linear-gradient(left, hsla(0, 0%, 100%, 0) 0%, hsla(0, 0%, 100%, 0) 1.2%, hsla(0, 0%, 100%, .15) 2.2%), linear-gradient(180deg, hsl(0, 0%, 78%) 0%, hsl(0, 0%, 90%) 47%, hsl(0, 0%, 78%) 53%, hsl(0, 0%, 70%)100%);
margin: 0;
padding: 0;
}
+0
你可以做一个小提琴吗?另外,尝试一下,这可以在黑暗中拍摄,以设置画布显示屏。 –
+0
你能正确指定问题吗? –