Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何按行排列图像并使用lightbox_Javascript_Html_Css - Fatal编程技术网

Javascript 如何按行排列图像并使用lightbox

Javascript 如何按行排列图像并使用lightbox,javascript,html,css,Javascript,Html,Css,我想在一页上放八张图片,每行有四张,它们的大小和排列方式是一致的。我以前就知道了,但是我的代码丢了。我有同样大小的图片,但我不能把它们分成两行,每行4张,我也不能让lightbox工作。我不确定这是不是因为我使用了一个div-box还是什么如何获取一行中的前四张照片和第二行中的第二张照片,并将它们对齐?我是否因为lightbox无法工作而做错了什么 <!DOCTYPE html> <html> <head> <title>Amber & M

我想在一页上放八张图片,每行有四张,它们的大小和排列方式是一致的。我以前就知道了,但是我的代码丢了。我有同样大小的图片,但我不能把它们分成两行,每行4张,我也不能让lightbox工作。我不确定这是不是因为我使用了一个div-box还是什么如何获取一行中的前四张照片和第二行中的第二张照片,并将它们对齐?我是否因为lightbox无法工作而做错了什么

<!DOCTYPE html>
<html>
<head>
<title>Amber & Melissa Engagement</title>

<meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="css/ecp.css">
    <link rel="stylesheet" type="text/css" href="css/lightbox.css">
    <script type="text/javascript" src="js/lightbox.min.js"></script>
 <div class=:"flowerLogo">
 <img src="img/engagementheader.png" style="width:100%">
 </div>
 <div class="partners">
 <div class="picture">
 <a href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement1.png"     data-lightbox="gallery"><img src="img/engagement1.png"/></a>
<div class="picture">   
<a href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement2.png"     data-lightbox="gallery"><img src="img/engagement2.png"/></a>
<div class="picture"> 
<a href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement3.png"     data-lightbox="gallery"><img src="img/engagement3.png"/></a>
<div class="picture">
<a href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement4.png"     data-lightbox="gallery"><img src="img/engagement4.png"/></a>
<div class="partners">
<div class="picture">

 <a     href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement5.png"     data-lightbox="gallery"><img src="img/engagement5.png"/></a>
 <div class="picture">
 <a href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement6.png"     data-lightbox="gallery"><img src="img/engagement6.png"/></a>
<div class="picture">
 <a       href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement7.png"     data-lightbox="gallery"><img src="img/engagement7.png"/></a>
<div class="picture">
 <a     href="https://azoltek.000webhostapp.com/ElizabethChristina/img/engagement8.png"     data-lightbox="gallery"><img src="img/engagement8.png"/></a>

</div>

看起来你忘了问问题了,斯梅农。你的控制台在lightbox方面有什么错误吗?我用的是Sublime文本,所以我不确定会显示在哪里。另外,如果窗口缩小,我会尝试将图像调整到窗口大小。我在谷歌上搜索过它,并尝试了一些代码,但它将图像还原为完整大小,全部放在一列中。好的,我让lightbox工作了。但是我不能让图标显示出来。我把它们放在我的img文件夹下。我必须更改jquery,这就是问题所在。因此,我所需要做的就是找出当浏览器窗口变小时如何调整图像大小,并使lightbox的图像正常工作。
.partners{
white-space: nowrap;
width: 100%;
text-align: center;

}


.picture{ 
display: inline-block;
padding-top: 20px;
display: table-cell;

}
.picture img{
height: 450px;
width: 300px;  
padding: 20px;
vertical-align: middle;