我在我的網站上創建了一個導航欄,我希望我的標誌在導航欄內顯示在我的網站名稱旁邊,但它不想合作。在下面的代碼是我的導航欄內的圖像的HTML。圖像沒有出現在div內
下面是我的CSS看起來像。我嘗試了所有不同的位置類型,並試圖設置navimage的邊距和填充。
.navbar {
width: 100%;
height: 50px;
background-color: #2ecc71;
z-index: 1;
position: absolute;
top: 0;
left: 0;
}
#navtitle {
color: white;
font-family: cursive;
font-size: 25px;
position: relative;
top: 20;
margin-top: 10px;
margin-left: 40px;
}
#navimage {
position: absolute;
margin-top: 0px;
margin-left: 140px;
}
<div class="navbar">
<p id="navtitle">Rainforest</p>
<div class="navimage">
<a>
<img src='http://i.imgur.com/Eqbvkgb.png'>
</a>
</div>
</div>
任何想法?
感謝羅布。這結束了工作。 – Jbur43