https://imgur.com/a/b667X1Y
Я делаю проект для своего курса ИТ.У меня возникли проблемы с адаптацией сайта.Мой логотип и моя панель навигации кажутся отзывчивыми, но изображение дома, похоже, не отзывчивым.(Ссылка выше - 90% увеличение)
Я попытался изменить размер ширины и высоты, но, поскольку я очень новичок в этом, я изо всех сил пытаюсь решить эту проблему.
Я хотел быкак верхнее изображение, чтобы быть отзывчивым.Как мне это сделать?
@charset "utf-8";
/* CSS Document */
body {
margin: 0px;
}
/*This is the container css*/
.container {
margin-left: 200px;
margin-right: 200px;
margin-top: 0;
box-sizing: border-box;
}
.logo {
position: relative;
display: inline-block;
}
.logo h1 {
margin-top: 20px;
margin-bottom: 0;
color: #232323;
font-family:Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", Monaco, "Courier New", "monospace";
}
.navbar {
float: right;
top: 0;
padding: 10px;
}
.navbar ul a:hover {
padding: 5px;
margin: 0;
background-color: lightblue;
}
.navbar li {
display: inline-block;
text-decoration: none;
padding: 10px;
color: black;
font-family: Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", Monaco, "Courier New", "monospace";
}
/*This is the top image css*/
#top-img {
background-image: url("images/top-img.jpg");
background-position: center;
min-width: 100%;
height: 500px;
position: relative;
background-repeat: no-repeat;
border-bottom: solid #3E3E3E 3px;
}
/*This is the @media i am trying to make the top image responsive*/
@media screen and (min-width: 40em) {
#top-img {
max-width: 50em;
}
}
@media screen and (min-width: 64em) {
#top-img {
max-width: 70em;
}
}
<html>
<head>
<meta charset="utf-8">
<title>Plantscape</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div id="top-img">
<div class="container">
<header>
<div class="logo">
<h1>Plantscape</h1>
</div>
<div class="navbar">
<ul>
<a href="portfolio.html"><li>Folio</li></a>
<a href="services.html"><li>Services</li></a>
<a href="about.html"><li>About Us</li></a>
<a href="contact.html"><li>Contact Us</li></a>
</ul>
</div>
</header>
</div>
</div>
</body>
</html>