我有一个问题,当我的网站调整大小时,我的网站标题在图片横幅下消失了,对于我的生活,我找不到原因!
似乎我错过了一些css风格可能,我不确定.
标题是一个带有左右两列的div,当调整屏幕大小时,这些列会堆叠在一起.
HTML个
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link href="assets/css/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<header><div class="head-container">
<div class="head-item-left">1</div>
<div class="head-item-right">2</div>
</div>
</header>
<div class"top-banner-holder">
<div><img src="images/Southend Furniture Warehouse Store.jpg" class="top-banner-pic" alt="" /></div>
</div>
</body>
</html>
CSS:个
@charset "utf-8";
/* CSS Document */
/* Add this as properties to a selector */
body {
margin: 0;
width: 100%;
background-color: lightgrey;
}
* {
box-sizing: border-box;
}
/* Header style */
.head-container {
display: flex;
flex-direction: row;
font-size: 30px;
text-align: center;
height: 100px;
z-index: 1000;
}
.head-item-left {
background-color: green;
padding: 30px;
flex: 50%;
}
.head-item-right {
background-color: green;
padding: 30px;
flex: 50%;
}
/* Responsive layout - makes a one column-layout instead of two-column layout */
@media (max-width: 800px) {
.head-container {
flex-direction: column;
}
}
.top-banner-pic {
width: 100%;
height: 715px;
object-fit: cover;
object-position: 80% 100%;
}