如何将这两者对齐在div的顶部或者只是去掉画布底部的空间?
<style>
html, body, div, canvas {
margin: 0;
padding: 0;
}
</style>
<div style="border: solid 1px Grey;">
<a style="border: solid 1px Grey">Test</a>
<canvas style="border: solid 1px Grey;width:30px;height: 30px"></canvas>
</div>
答案 0 :(得分:0)
<html>
<head>
<title>Test</title>
<style>
.Left {
float: left;
border: 1px solid red;
width: 30px;
}
.Right {
float: left;
border: 1px solid green;
width: 35px;
}
.Outer {
border: solid 1px Grey;
height: 50px;
width: 100%;
}
</style>
</head>
<body>
<div class="Outer">
<div class="Left"><a style="border: solid 1px Grey">Test</a></div>
<div class="Right">
<canvas style="border: solid 1px Grey;width:30px;height:30px">
<!--Your Canvas-->
</canvas>
</div>
</div>
</body>
</html>