我是新來的HTML和CSS。我試圖讓我的導航欄水平顯示,並在文字鏈接上方有背景圖片。帶圖像的水平導航欄; CSS不顯示「內聯」
這裏是我的失敗/企圖代碼:
CSS:
#aside_sect_mm {
\t margin: 0px;
\t background-position: 0%;
\t background-color: #004E27;
\t max-width: 704px;
\t max-height: 100px;
\t background-repeat: no-repeat;
\t position: relative;
}
#aside_sect_mm nav {
\t text-align: justify;
\t max-width: 704px;
\t width: 100%;
\t max-height: 100px;
\t margin-top: 0%;
\t padding: 0px;
\t display: inline-block;
\t position: relative;
}
#aside_sect_mm nav ul {
\t padding: 0px 0px 0px 0px;
\t max-height: 100px;
\t max-width: 704px;
\t position: relative;
\t display: inline-block;
}
#aside_sect_mm nav ul li {
\t font-size: 1.1em;
\t font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
\t font-weight: lighter;
\t text-align: justify;
\t list-style: none;
\t line-height: 3.5em;
\t position: relative;
\t padding: 30px 0px 0px 0px;
\t margin-left: 4.5em;
\t max-height: 100px;
\t color: #FCE011;
\t display: inline-block;
\t position: relative;
}
#aside_sect_mm nav ul li.bio_icon, #aside_sect_mm nav ul li.stat_icon, #aside_sect_mm nav ul li.img_icon, #aside_sect_mm nav ul li.vid_icon, #aside_sect_mm nav ul li.fut_icon {
\t position: relative;
\t max-height: 100px;
\t max-width: 50%;
background-repeat: no-repeat;
\t background-position: 50% 0%;
\t display: block;
}
#aside_sect_mm nav ul li.bio_icon {
\t background-image: url(../svg/bio_ore_ylw.svg);
}
#aside_sect_mm nav ul li.stat_icon {
\t background-image: url(../svg/stats_ore_ylw.svg);
}
#aside_sect_mm nav ul li.img_icon {
\t background-image: url(../svg/img_ore_ylw.svg);
}
#aside_sect_mm nav ul li.vid_icon {
\t background-image: url(../svg/vids_ore_ylw.svg);
}
#aside_sect_mm nav ul li.fut_icon {
\t background-image: url(../svg/fut_ore_ylw.svg);
}
#aside_sect_mm nav ul li.bio_icon a, #aside_sect_mm nav ul li.stat_icon a, #aside_sect_mm nav ul li.img_icon a, #aside_sect_mm nav ul li.vid_icon a, #aside_sect_mm nav ul li.fut_icon a {
\t position: relative;
\t display: block;
\t max-height: 100px;
\t max-width: 50%;
\t text-decoration: none;
color: #F6EF1B;
}
#aside_sect_mm nav ul li.bio_icon a:hover, #aside_sect_mm nav ul li.stat_icon a:hover, #aside_sect_mm nav ul li.img_icon a:hover, #aside_sect_mm nav ul li.vid_icon a:hover, #aside_sect_mm nav ul li.fut_icon a:hover {
position: relative;
\t max-height: 100px;
\t max-width: 50%;
display: block;
background-color: #F6EF1B;
\t background-repeat: no-repeat;
\t background-position: -26px 0%;
\t text-decoration: none;
color: #004E27;
}
#aside_sect_mm nav ul li.bio_icon a:hover {
\t background-image: url(../svg/bio_ore_grn.svg);
}
#aside_sect_mm nav ul li.stat_icon a:hover {
\t background-image: url(../svg/stats_ore_grn.svg);
}
#aside_sect_mm nav ul li.img_icon a:hover {
\t background-image: url(../svg/img_ore_grn.svg);
}
#aside_sect_mm nav ul li.vid_icon a:hover {
\t background-image: url(../svg/vids_ore_grn.svg);
}
#aside_sect_mm nav ul li.fut_icon a:hover {
\t background-image: url(../svg/fut_ore_grn.svg);
}
And the HTML:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/test.css">
</head>
<body>
<section id="aside_sect_mm">
<nav>
<ul>
<li class="bio_icon"><a href="#bio">Bio</a></li>
<li class="stat_icon"><a href="#stats">Stats</a></li>
<li class="img_icon"><a href="#images">Images</a></li>
<li class="vid_icon"><a href="#videos">Videos</a></li>
<li class="fut_icon"><a href="#future">Future</a>
</ul>
</nav>
</section>
</body>
</html>
如果一個人的專業知識可以在正確的方向指向我,我會非常感激的幫助。
哪裏是背景圖片? –