gpt4 book ai didi

用于排列图像链接的 HTML

转载 作者:太空宇宙 更新时间:2023-11-04 01:36:55 24 4
gpt4 key购买 nike

我是 HTML 的新手,但我已将其与在线代码拼凑在一起。

唯一的问题是这 18 张图片应该排列成 3 行,每行 6 张(同时保持当前的悬停和链接功能),而不是像现在这样垂直堆叠。有任何想法吗?

.containerS1IR {
position: relative;
width: 15%;
}

.imageS1IR {
opacity: 1;
display: float;
left;
width: 50%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
cursor: pointer;
}

.middleS1IR {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 49%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}

.containerS1IR:hover .imageS1IR {
opacity: 0.5;
}

.containerS1IR:hover .middleS1IR {
opacity: .80;
}

.textS1IR {
background-color: maroon;
color: white;
font-size: 20px;
padding: 5px 15px;
}
<h1>
<font color="#80000" size="+2">
<marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();">
The Office of Institutional Research has made the new menu below available for up and coming intuitive web-based reporting. Hover and click the images to navigate.
</marquee>
</font>
</h1>

<div class="containerS1IR">
<img src="https://i.imgur.com/jsn40Sd.png" alt="Enrollment Report Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Overall Enrollment</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/2XkEJjY.png" alt="Freshmen Cohort Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Freshmen Cohort</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/4yA0mlU.png" alt="Student Sub-Populations Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Student Sub-Populations</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/V2666d5.png" alt="Enrollment to Date Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Enrollment to Date</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/alt1B7g.png" alt="Student Success Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Student Success</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/HcC3UCA.png" alt="Academic Costs and Productivity Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Academic Costs and Productivity</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/x9LIrOH.png" alt="Academic Outcomes Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Academic Outcomes</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/084vJ33.png" alt="Finances Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Finances</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/wgyN38M.png" alt="Human Resources Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Human Resources</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/sCN2zbS.png" alt="Infrastructure Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Infrastructure</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/u56c9fv.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/zcZeURw.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/r1LNJZl.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/5BAaZE3.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/BhZlD2g.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/1Cj8Lhu.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/ADhQmDa.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/96ccSVQ.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

非常感谢您,林赛

最佳答案

您只需 float 容器,这样它就不会像 block 元素通常那样占据整个宽度。

.containerS1IR {
position: relative;
width: 15%;
float: left;
}

.imageS1IR {
opacity: 1;
width: 50%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
cursor: pointer;
}

.middleS1IR {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 49%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}

.containerS1IR:hover .imageS1IR {
opacity: 0.5;
}

.containerS1IR:hover .middleS1IR {
opacity: .80;
}

.textS1IR {
background-color: maroon;
color: white;
font-size: 20px;
padding: 5px 15px;
}
<h1><font color="#80000" size="+2">
<marquee behavior="scroll" direction="left" onmouseover="this.stop();"
onmouseout="this.start();">
The Office of Institutional Research has made the new menu below available
for up and coming intuitive web-based reporting. Hover and click the images
to navigate.
</marquee></font></h1>


<div class="containerS1IR">
<img src="https://i.imgur.com/jsn40Sd.png" alt="Enrollment Report Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Overall Enrollment</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/2XkEJjY.png" alt="Freshmen Cohort Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Freshmen Cohort</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/4yA0mlU.png" alt="Student Sub-Populations Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Student Sub-Populations</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/V2666d5.png" alt="Enrollment to Date Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Enrollment to Date</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/alt1B7g.png" alt="Student Success Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Student Success</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/HcC3UCA.png" alt="Academic Costs and Productivity Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Academic Costs and Productivity</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/x9LIrOH.png" alt="Academic Outcomes Link" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Academic Outcomes</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/084vJ33.png" alt="Finances Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Finances</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/wgyN38M.png" alt="Human Resources Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Human Resources</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/sCN2zbS.png" alt="Infrastructure Link"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Infrastructure</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/u56c9fv.png" alt="Coming Soon" class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/zcZeURw.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/r1LNJZl.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/5BAaZE3.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/BhZlD2g.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/1Cj8Lhu.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/ADhQmDa.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

<div class="containerS1IR">
<img src="https://i.imgur.com/96ccSVQ.png" alt="Coming Soon"
class="imageS1IR" style="width:100%" onclick="location.href='https://info.schreiner.edu/ICS/University_Resources/Institutional_Research/Census_Report.jnz';">
<div class="middleS1IR">
<div class="textS1IR">Coming Soon</div>
</div>
</div>

或者你可以使用display: inline-block,效果一样。

关于用于排列图像链接的 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46045725/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com