【发布时间】:2018-06-11 14:56:13
【问题描述】:
我对 html/css 非常陌生,我想了解如何使用 div 创建响应式图像网格。 我的编解码器:
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Website</title>
<style>
.container {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 40vh 30vh 30vh;
grid-gap: 10px;
}
.header > img {
grid-column: 1/ span 4;
grid-row: 1 / span 6;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<img src="/home/image/my_2.png" />
</div>
</div>
</body>
</html>
我不知道如何将图像定位到标题,请任何人帮助,如何做,谢谢!
【问题讨论】:
-
提供更多细节。
-
欢迎来到 Stack Overflow!请澄清您的具体问题或添加其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
-
感谢您的回答! ,我对 html/css 很陌生...。我将图像放到我的标题登陆,但我不知道该怎么做...
-
@3edf1w 欢迎。查看minimal reproducible example 了解我们需要多少代码才能为您提供帮助!具体来说,我们需要问题中的代码作为文本,而不是图像。