我正在尝试在标题中显示图像作为背景,但似乎没有任何反应。
这是我设置图像规格的css代码(500 * 2000):
header{
background-image: url(../images/banner2.png);
background-repeat: no-repeat;
margin: 0 auto;
max-height:100px;
width: 100%;
}
这是我的 HTML 代码:
<!DOCTYPE html>
<html>
<head>
<title>Contact</title>
<link rel="stylesheet" href="../css/main.css" />
</head>
<body id = "contact">
<header></header>
<div id="page">
<div id="logo">
<h1><a href="../html/index.html" id="logoLink">Baby kleding online</a></h1>
</div>
<div id="nav">
<ul>
<li><a href="../html/index.html"id="homenav">Home</a></li>
<li><a href="../html/kleding.html"id="kledingnav">Kleding</a></li>
<li><a class="inuse" href="../html/contact.html"id="contactnav">Contact</a> </li>
<li><a href="../html/vragen.html"id="vragennav">Vragen</a></li>
</ul>
</div>
<div class="content">
<h2>Contact</h2>
</div>
<div class="Images">
<b target="_blank" href="kleding.htm">
<img src="../images/logo.PNG" alt="Boy1" width="300" height="140">
</b>
</div>
</div>
</body>
</html>