简体   繁体   English

如何在CSS缩略图库中获取开始图片

[英]How to get a start picture in CSS thumbnail gallery

I found a Stack problem, with a nice gallery solution. 我发现了一个堆栈问题,并提供了一个不错的画廊解决方案。 I used the code to make my own too. 我也使用代码来编写自己的代码。 The structure working perfectly fine and I made it fully dynamic but I have a small problem with it. 该结构运行得很好,我使它完全动态,但是我有一个小问题。

Here is a Gallery solution from @Seika85: 这是@ Seika85的Gallery解决方案:

Link from the original 原始链接

PROBLEM: I cant get the start text replaced to the IMG1 in dl 问题:我无法将开始文本替换为dl中的IMG1

I would like to replace the "Hover a thumbnail" to the first full size picture in the gallery. 我想将“悬停缩略图”替换为图库中的第一张全尺寸图片。 When you open the page the dl is empty and first get loaded only when you go over or click on a thumbnail. 当您打开页面时,dl为空,仅当您翻阅或单击缩略图时才首先加载。

Example: 例:

I would like to get it loaded like this 我想像这样加载它 我想像这样加载它,

instead of that one when i open the page. 而不是当我打开页面时。 而不是那个

The text arena code before get the first picture loaded: 加载第一张图片之前的文本区域代码:

dl.container:before {
content: "Hover a thumbnail";
position: absolute;
font: 48px Tahoma;
display: block;
top: 150px;
color: #d8d8d8;
text-shadow: 1px 1px 3px #666;
width: 100%;
text-align: center;}

I hope I can get a solution to make it work, Thanks. 希望我能找到一种解决方案,以使其正常运行,谢谢。

Just add: 只需添加:

dt:first-child + dd {
  opacity: 1;
}

To make the first one "active/visible" by default. 默认情况下使第一个“活动/可见”。

Updated Fiddle 更新小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM