我希望将我的页面徽标放在左上角,并用黑色背景包围。 但是,背景颜色不覆盖图像右侧的区域。 我正在使用HTML和CSS。
这是我的代码:
这是我的代码:
#title {
width: 100%;
height: 100%;
background-color: black;
}
#title img {
width: 50%;
height: 50%;
}
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="index.css" media="screen" />
<body>
<div id="title">
<a href="index.html">
<img src="http://i.stack.imgur.com/WE2r4.png" align="left" />
</a>
</div>
</body>
</html>