如何制作"关于"向下移动的盒子,即使是"电子邮件"框。 我尝试过高度="某事"但它不会向下移动,所以它会混淆我的页面。
所以基本上我想要"关于"盒子大小与盒子相同"照片,电子邮件,Whatsapp等。"高度。
代码:
QPushButton

答案 0 :(得分:0)
尺寸不匹配的原因是您在/关于“关于”之后错过了 BR 标签 - 所以它应该是:
<canvas id="About" width="200" height="30" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas> <br>
<script>
然后你会把它们连成一排。
您还需要正确关闭标题和HTML标记,所以在底部
</body>
</head>
</html>
如果您想将所有内容放在标题中。
以下是修改后的代码:
<!DOCTYPE html>
<html>
<head>
<body>
<canvas id="Photo" width="200" height="230" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
var canvas = document.getElementById("Photo");
var ctx = canvas.getContext("2d");
ctx.font = "30px Arial";
ctx.fillText("Photo Here",20,110);
</script><br>
<canvas id="About" width="200" height="230" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas><br>
<script>
var canvas = document.getElementById("About");
var ctx = canvas.getContext("2d");
ctx.font = "30px Arial";
ctx.fillText("About Page",150,110);
</script><br>
<canvas id="Real_Name" width="200" height="30" style="border:1px solid #000000;"><br>
Your browser does not support the HTML5 canvas tag.
</canvas>
<script> var canvas = document.getElementById("Real_Name");
var ctx = canvas.getContext("2d");
ctx.font = "15px Arial";
ctx.fillText("Real Name",60,20);
</script><br>
<canvas id="Role" width="200" height="30" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
var canvas = document.getElementById("Role");
var ctx = canvas.getContext("2d");
ctx.font = "15px Arial";
ctx.fillText("Role",81,20);
</script><br>
<canvas id="WhatsApp" width="200" height="30" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas><br>
<script>
var canvas = document.getElementById("WhatsApp");
var ctx = canvas.getContext("2d");
ctx.font = "15px Arial";
ctx.fillText("WhatsApp",60,20);
</script>
<canvas id="Email" width="200" height="30" style="border:1px solid #000000;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
var canvas = document.getElementById("Email");
var ctx = canvas.getContext("2d");
ctx.font = "15px Arial";
ctx.fillText("Email",77,20);
</script>
</body>
</head>
</html>