【发布时间】:2018-10-20 11:01:01
【问题描述】:
这可能是一个非常愚蠢的问题,但我的导航 div 的背景不会显示,我真的不知道这个问题,css 文件已链接并使用一些元素。
图像属性 大小:10kb -位深度:32 -尺寸:宽:300 高:190 -文件类型:png -名称:Nav_Background
需要做什么 http://prntscr.com/l89oq0
Index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Portfolio Template</title>
<meta name="author" content="name">
<meta name="description" content="description here">
<meta name="keywords" content="keywords,here">
<link rel="shortcut icon" href="favicon.ico" type="">
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<div class="nav">
</div>
</div>
</body>
</html>
main.css
/*----------Global----------*/
* {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
.clearfix::after{
content: "";
clear: both;
display: table;
}
html{
font-family: circular std, sans-serif;
font-weight: 100;
}
body{
width: 100%;
margin: auto;
background: white; /*Replace with background image
background-position: top;
background-size: cover;
background-repeat: no-repeat;*/
}
/*----------Navigation----------*/
.nav {
background-image: url(images/Nav_Background.png);
background-position: right top;
background-size: 300px 191px;
margin-top: 5px;
}
【问题讨论】: