这幅画在我的部分标签(下面的代码)不会显示在页面上。我想知道为什么..。
HTML:
<!doctype html>
<html lang="pl">
<title>Strona</title>
<head>
<meta charset="utf-8">
<link href="style.css" rel="stylesheet" screen="media,projection">
</head>
<body>
<section>
</section>
</body>
</html>CSS:
html {
width:100%;
height:1230px;
}
body {
width:90%
height:100%;
}
section {
width:100%;
height:19.19%;
background:url(header.jpg); *this path should work because the file is on my hard drive, this is not the issue of the path..
background-size:100% 100%;
background-repeat:no-repeat;
}另外,当我调整浏览器窗口的大小时,我希望我的图片按比例缩放(宽度和高度)。
发布于 2015-11-15 14:24:33
您丢失的分号在体宽语法错误上
html {
width:100%;
height:1230px;
}
body {
width:90%;
height:100%;
}
section {
width:100%;
height:19.19%;
background-image:url("http://s12.postimg.org/xx34q95m3/header.jpg");
background-size:100% 100%;
background-repeat:no-repeat;
}<section></section>
发布于 2015-11-15 14:31:40
使用这个HTML,有些东西应该写在节里,分号在正文中也少了。
<!doctype html>
<html lang="pl">
<head><title>Strona</title>
<meta charset="utf-8">
<link href="style.css" rel="stylesheet" screen="media,projection">
</head>
<body>
<section>Saurabh Singh Mehra</section>
</body>
</html>CSS
html {
width:100%;
height:1230px;
}
body {
width:90%;
height:100%;
}
section {
width:100%;
height:19.19%;
background:url(header.jpg);
background-size:100% 100%;
background-repeat:no-repeat;
}https://stackoverflow.com/questions/33720657
复制相似问题