我创建了一个画布,并使用 JavaScript 在画布内创建了一个圆圈。我曾经stroke()给圆圈一个边框,但我不知道如何增加边框的宽度。我以为我可以使用strokeWidth(),但我不确定。
var c=document.getElementById('canvas');
var ctx=c.getContext('2d');
ctx.beginPath();
ctx.fillStyle="blue";
ctx.arc(150,73,70,0,2*Math.PI);
ctx.fill();
ctx.strokeStyle="yellow";
ctx.stroke();
ctx.closePath();Run Code Online (Sandbox Code Playgroud)
#canvas{
height: 250px;
width: 500px;
background-color: orange;
border: 1px solid black;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
display:block;
}Run Code Online (Sandbox Code Playgroud)
<canvas id="canvas" width=500 height=250></canvas>Run Code Online (Sandbox Code Playgroud)
我创建了一个导航栏,所有标签都是内联的.当窗口大小减小时,会出现一个条形图标,标签垂直显示而不是水平显示.我想要输出,这样当窗口大小减小时,会出现条形图标,但是标签会消失,只能在垂直方向看到并且在单击条形图标时看不见.我试过jquery,但它没有用.我不知道怎么做,你能帮帮我吗?
body {
margin: 0;
padding: 0;
font-family: Sans-Serif;
}
nav {
margin-left: 45px;
;
width: 90%;
background: #D1D0D3;
}
ul {
list-style-type: none;
width: 80%;
margin: 0 auto;
color: black;
padding: 0;
}
ul a {
color: black;
text-decoration: none;
}
ul li {
display: inline-block;
padding: 20px;
}
ul li:hover {
background-color: yellow;
}
.toggle {
width: 100%;
padding: 10px 20px 0px 20px;
background-color: #C2ABF1;
text-align: right;
box-sizing: border-box;
color: white;
font-size: 30px;
display: none;
}
@media (max-width: …Run Code Online (Sandbox Code Playgroud)