Boxes not aligning correct - css

I have tested my code on jsfiddle and it looks fine but for some reason on the live site the boxes have lost the alignment Why? it loads the first two boxes fine
HTML:
<div class="listingContainer">
<h2></h2>
<div class="sectionListingAttributes">
<div class="col0">
<span class="name">Property type:</span>
<span class="value">Section</span><br/>
<span class="name">Price:</span>
<span class="value">To be sold by auction on 4 Dec</span><br/>
<span class="name">Land area:</span>
<span class="value">301m²</span>
</div>
</div>
<div class="description">
<span class="value text">
</span>
</div>
<div class="gallery">
<div class="flexslider loading">
<ul class="slides">
{{ files:listing folder="10" }}
<li><img src="{{ url:site }}files/large/{{ filename }}" alt="" /></li>
{{ /files:listing }}
</ul>
</div>
</div>
</div><!-- listingAttributes End -->
<h2></h2>
<div class="sectionListingAttributes">
<div class="col0">
<span class="name">Property type:</span>
<span class="value">Section</span><br/>
<span class="name">Price:</span>
<span class="value">To be sold by auction on 4 Dec</span><br/>
<span class="name">Land area:</span>
<span class="value">333m²</span>
</div>
</div>
<div class="description">
<span class="value text">
</span>
</div>
<div class="gallery">
<div class="flexslider loading">
<ul class="slides">
{{ files:listing folder="12" }}
<li><img src="{{ url:site }}files/large/{{ filename }}" alt="" /></li>
{{ /files:listing }}
</ul>
</div>
</div>
</div><!-- listingAttributes End -->
<h2></h2>
<div class="sectionListingAttributes">
<div class="col0">
<span class="name">Property type:</span>
<span class="value">Section</span><br/>
<span class="name">Price:</span>
<span class="value">To be sold by auction on 4 Dec</span><br/>
<span class="name">Land area:</span>
<span class="value">300m²</span>
</div>
</div>
<div class="description">
<span class="value text">
</span>
</div>
<div class="gallery">
<div class="flexslider loading">
<ul class="slides">
{{ files:listing folder="13" }}
<li><img src="{{ url:site }}files/large/{{ filename }}" alt="" /></li>
{{ /files:listing }}
</ul>
</div>
</div>
</div><!-- listingAttributes End -->
<h2></h2>
<div class="sectionListingAttributes">
<div class="col0">
<span class="name">Property type:</span>
<span class="value">Section</span><br/>
<span class="name">Price:</span>
<span class="value">To be sold by auction on 4 Dec</span><br/>
<span class="name">Land area:</span>
<span class="value">301m²</span>
</div>
</div>
<div class="description">
<span class="value text">
</span>
</div>
<div class="gallery">
<div class="flexslider loading">
<ul class="slides">
{{ files:listing folder="14" }}
<li><img src="{{ url:site }}files/large/{{ filename }}" alt="" /></li>
{{ /files:listing }}
</ul>
</div>
</div>
</div><!-- listingAttributes End -->
</div> <!-- listingContainer End -->
CSS:
.listingContainer{
width:960px;
height:100%;
}
.listingContainer h2{
height:30px;
width: 100%;
margin: 10px 10px 0 10px;
}
.listingAttributes{
width:100%;
height:165px;
margin: 15px 10px -5px 10px;
border-bottom: 1px solid #FFB400;
}
.listingAttributes .col0, .col1{
width:160px;
height: 100%;
margin:0 15px 0 0;
float:left;
display: inline-block;
}
.listingAttributes .col2{
width:180px;
height: 100%;
margin:0 15px 0 0;
float:left;
display: inline-block;
}
.listingAttributes .col3{
width:200px;
height:100%;
float:left;
display: inline-block;
}
.listingAttributes .col4{
width:200px;
height:100%;
float:left;
display: inline-block;
}
.listingAttributes .sectionListingAttributes, .name{
font-weight: bold;
}
.sectionListingAttributes{
width:100%;
height:90px;
margin: 15px 10px -5px 10px;
border-bottom: 1px solid #FFB400;
}
.sectionListingAttributes .col0{
width:250px;
height: 100%;
margin:0 15px 0 0;
float:left;
display: inline-block;
}
.description{
width:930px;
min-height: auto;
max-height: 100%;
overflow: auto;
margin:0 0 0 10px;
padding: 10px;
border-bottom: 1px solid #FFB400;
}
.text, .value{
font-size: 14px;
text-align: left;
}

The first two are contained inside the div with id container and class w960 whereas all the rest are not.
UPDATE: Based on your code posted above, you have this line </div><!-- listingAttributes End --> about half way down that I believe you want to be closing the <div class="sectionListingAttributes"> element, however, that element is actually closed just after the <div class="col0"> is closed, so one of the two closings would seem to be incorrect.

Related

How to enable pagination on vertically aligned Angular Material tabs (mat-tabs)?

I arranged my angular material tabs vertically using CSS. Unfortunately, the pagination to navigate to the invisible tabs is not displayed
My container has a fixed height (max-height: 177px) so that only a certain number of tabs are visible. The pagination should appear when this fixed height is exceeded.
Here is my CSS / SCSS for the vertical tabs:
:host ::ng-deep {
.mat-tab-group {
flex-direction: row-reverse;
.mat-tab-nav-bar,
.mat-tab-header {
border: 0;
}
.mat-tab-header {
display: flex;
align-items: flex-end;
max-height: 177px;
right: 50px;
bottom: 50px;
z-index: 2147483647;
.mat-tab-labels {
flex-direction: column;
background: gray;
.mat-tab-label {
margin: 0;
padding: 20px;
cursor: pointer;
&:not(:last-child) {
border-bottom: 1px solid white;
}
&.mat-tab-label-active {
background-color: white !important;
width: 100%;
}
}
}
}
.mat-tab-body-wrapper {
width: 100%;
height: 100%;
display: table;
}
}
}
My template is structured like this:
<content>
<div class="main-wrapper i-wrapper">
<div class="header">
<div class="title">
<h4>Title</h4>
</div>
</div>
<mat-tab-group mat-align-tabs="end">
<div *ngFor="let item of items; let i = index">
<mat-tab label="{{i}}">
<div class="device-map-container">
<div class="device-map">
<img id="img_equipment" [src]="apiUrl + '/path/to/svg/' + asset | sanitize">
<a *ngFor="let data of SVGdata"
title="{{ data.title }}"
class="device-link">
</a>
<div class="wrapper">
<!-- another angular component -->
</div>
</div>
</div>
</mat-tab>
</div>
</mat-tab-group>
</div>
</content>
In dev tools the templates looks like this:
<mat-tab-group _ngcontent-nnd-c412="" mat-align-tabs="end" animationduration="0ms" class="mat-tab-group mat-primary" ng-reflect-animation-duration="0ms">
<mat-tab-header class="mat-tab-header" ng-reflect-selected-index="0" ng-reflect-disable-ripple="false" ng-reflect-disable-pagination="false">
<div aria-hidden="true" mat-ripple="" class="mat-ripple mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4 mat-tab-header-pagination-disabled" ng-reflect-disabled="true">
<div class="mat-tab-header-pagination-chevron"></div>
</div>
<div class="mat-tab-label-container">
<div role="tablist" class="mat-tab-list" style="transform: translateX(0px);">
<div class="mat-tab-labels">
<div role="tab" mattablabelwrapper="" mat-ripple="" cdkmonitorelementfocus="" class="mat-ripple mat-tab-label mat-focus-indicator mat-tab-label-active ng-star-inserted" id="mat-tab-label-0-0" ng-reflect-disabled="false" tabindex="0" aria-posinset="1" aria-setsize="2" aria-controls="mat-tab-content-0-0" aria-selected="true" aria-disabled="false">
<div class="mat-tab-label-content">
</div>
</div>
<div role="tab" mattablabelwrapper="" mat-ripple="" cdkmonitorelementfocus="" class="mat-ripple mat-tab-label mat-focus-indicator ng-star-inserted" id="mat-tab-label-0-1" ng-reflect-disabled="false" tabindex="-1" aria-posinset="2" aria-setsize="2" aria-controls="mat-tab-content-0-1" aria-selected="false" aria-disabled="false">
<div class="mat-tab-label-content">
</div>
</div>
</div>
<mat-ink-bar class="mat-ink-bar" style="visibility: visible; left: 0px; width: 50px;"></mat-ink-bar>
</div>
</div>
<div aria-hidden="true" mat-ripple="" class="mat-ripple mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4 mat-tab-header-pagination-disabled" ng-reflect-disabled="true">
<div class="mat-tab-header-pagination-chevron"></div>
</div>
</mat-tab-header>
<div class="mat-tab-body-wrapper">
<mat-tab-body role="tabpanel" class="mat-tab-body ng-tns-c380-10 mat-tab-body-active ng-star-inserted" id="mat-tab-content-0-0" ng-reflect-_content="[object Object]" ng-reflect-position="0" ng-reflect-origin="1" ng-reflect-animation-duration="0ms" aria-labelledby="mat-tab-label-0-0">
<div class="mat-tab-body-content ng-tns-c380-10 ng-trigger ng-trigger-translateTab" style="transform: none;">
<div _ngcontent-nnd-c412="" class="device-map-container ng-star-inserted" style="">
<div _ngcontent-nnd-c412="" class="device-map">
<img _ngcontent-nnd-c412="" id="img_equipment" alt="" src="data:image/svg+xml;base64,...">
</div>
</div>
</div>
</mat-tab-body>
<mat-tab-body role="tabpanel" class="mat-tab-body ng-tns-c380-11 ng-star-inserted" id="mat-tab-content-0-1" ng-reflect-_content="[object Object]" ng-reflect-position="1" ng-reflect-animation-duration="0ms" aria-labelledby="mat-tab-label-0-1">
<div class="mat-tab-body-content ng-tns-c380-11 ng-trigger ng-trigger-translateTab" style="transform: translate3d(100%, 0px, 0px); min-height: 1px;">
<!--container-->
</div>
</mat-tab-body>
</div>
</mat-tab-group>
Currently it looks like this (6 elements are visible. But there are more than 6 tabs in the container):

What is causing these huge gaps?

I am trying to display several items from a query onto this page. I am trying to make them so that 6 images are on a line and evenly spaced. However, it seems that no matter how I change the css, I still keep ending up with huge gaps in some places.
Here is the code I used to create this section:
<div class="container2">
<div class="category"><h2>All Items</h2></div>
<div class="display">
<?php do { ?>
<ul>
<li><a href="details.php?recordID=<?php echo $row_Master['Master_ID']; ?>"><img class="thumb" src="img/<?php echo $row_Master['Img']; ?>"/>
<br />
<?php echo $row_Master['Name']; ?></a></li>
</ul>
<?php } while ($row_Master = mysqli_fetch_assoc($Master)); ?>
<!-- end .display --></div>
<?php
mysqli_free_result($Master);
?>
<!-- end .container2 --></div>
and the CSS associated with it:
.container2 {
margin:0 auto;
text-align: center;
width:95%;
background-color:#FFFFFF;
}
.display{
width:100%;
margin-left:auto;
margin-right:auto;
text-align:center;
overflow:hidden;
}
.display ul li {
float:left;
max-width:15.67%;
margin: 0 0 8% 1%;}
.display ul{
list-style:none;
}
img.thumb {
border:0;
max-height:150px;
min-width:16.67%;
vertical-align:middle;
padding:3px;}
Can anyone help me remove these huge gaps, plz?
Flexbox for the win.
You can get six across wrapping rows with this config. The flex container gets:
display: flex;
flex-wrap: wrap;
And the flex items get:
flex: 0 0 16.666%;
I added several comments in the CSS to explain what I did here. This approach takes a bit of practice but once you get it you will never use floats for layout again.
Here is a great resource that explains the flexbox approach really well: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
* { box-sizing: border-box; }
.display {
border: 2px solid red; /* just for demo visibility */
}
.display ul {
/* ul reset */
list-style: none;
padding: 0;
margin: 0;
/* flexbox layout - flex container config */
display: flex;
flex-wrap: wrap;
}
.display ul li {
border: 2px solid dodgerblue; /* just for demo visibility */
padding: 10px; /* use padding to create spacing between items, remove the borders to get the final look */
/* flex item config */
flex: 0 0 16.66%; /* 100 divided by 6 is 16.666... */
}
.display ul li span {
display: block;
text-align: center;
}
.display ul li img {
max-width: 100%;
height: auto;
}
<div class="container2">
<div class="category">
<h2>All Items</h2>
</div>
<div class="display">
<ul>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 1</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 2</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 3</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 4</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 5</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 6</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 7</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 8</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 9</span>
</a>
</li>
<li>
<a href="x">
<img class="thumb" src="https://picsum.photos/120" />
<span class="name">Thing 10</span>
</a>
</li>
</ul>
</div>
</div>

Z-index not working on div on fixed position header

I have a page using a masterpage in asp.net 4.0. My masterpage has header which has a search box. Header has css position fixed and have z-index 10.
I am trying to create a search instruction which will open when user types anything. my instruction box do not show as floatig over header instead it opens inside header and expands it. Here are my css and html
header {
width:100%;
display:inline-block;
background-color:#ef4023;
position:fixed;
z-index:10;
}
header #Guide {
width: 100%;
z-index: 5;
margin-right: -1px;
position:relative;
background: #eee;
border: 1px solid #ccc;
}
<header>
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-4">
<div class="logo">
<img src="images/logo.png" alt="logo" class="img-responsive" />
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-10 col-xs-8">
<div class="col-md-6">
<!--SearchBarStart-->
<div ng-controller="MyCtrl">
<form>
<h3>Search Here </h3>
<input type="text" class="form-control" id="SearchKeyword" ng-model="searchText" required="required" />
<div class="list-group" id="Guide" ng-show="showLinks">
<a class="list-group-item" href="" ng-click="SearchType(0,true,'KeyWord', 1)">
<div class="input-group">
<span class="fa fa-suitcase"></span><span style="padding-left: 20px">instruction goes here</span>
</div>
</a>
</div>
</form>
</div>
</div>
</div>
</header>
You have to use position: fixed also on the instruction box, with according position settings. (relative will put it into the document flow, thereby taking up space, and absolute won't work since you don't have a relative parent for it.)
header {
width: 100%;
display: inline-block;
background-color: #ef4023;
position: fixed;
z-index: 10;
}
header #Guide {
width: 100%;
z-index: 15;
margin-right: -1px;
position: fixed;
top: 110px;
left: 0px;
background: #eee;
border: 1px solid #ccc;
}
<header>
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-4">
<div class="logo">
<img src="images/logo.png" alt="logo" class="img-responsive" />
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-10 col-xs-8">
<div class="col-md-6">
<!--SearchBarStart-->
<div ng-controller="MyCtrl">
<form>
<h3>Search Here </h3>
<input type="text" class="form-control" id="SearchKeyword" ng-model="searchText" required="required" />
<div class="list-group" id="Guide" ng-show="showLinks">
<a class="list-group-item" href="" ng-click="SearchType(0,true,'KeyWord', 1)">
<div class="input-group">
<span class="fa fa-suitcase"></span><span style="padding-left: 20px">instruction goes here</span>
</div>
</a>
</div>
</form>
</div>
</div>
</div>
</header>`

pure CSS lightbox issue

I'm working on a CSS photo gallery in CSS only and I've got a problem. I try to do a lightbox with 5 elements (pictures) and it worked perfectly. But when I want to add some new pictures, it doesn't work anymore and I don't know why. It's just like the last picture was displayed in full size in front of the other elements from the page (but with hidden property). So I see the page but I can't click the links...
Here is the code :
#GalleryContent {
height: 817px;
margin-top: 100px;
margin-left: 55px;
}
#gallery a {
text-decoration:none;
}
#gallery .item {
width: 200px; height: 200px; overflow: hidden;
float: left;
border: 5px solid #000;
margin: 5px;
box-shadow: 1px 1px 1px 1px #d8c4a3;
}
#gallery .item a {
overflow: hidden;
}
#gallery .item a img {
height: 100%;
align-self: center;
}
.lightbox {
/** Hide the lightbox */
opacity: 0;
/** Apply basic lightbox styling */
position: fixed;
z-index: 9999;
width: 100%;
height: 90%;
top: -100%;
left: 0;
color:#333333;
-webkit-transition: opacity .5s ease-in-out;
-moz-transition: opacity .5s ease-in-out;
-o-transition: opacity .5s ease-in-out;
transition: opacity .5s ease-in-out;
}
.lightbox:target {
/** Show lightbox when it is target */
opacity: 1;
outline: none;
top: 0;
}
.lightbox .box {
width: -webkit-min-content;
width: -moz-min-content;
width: min-content;
min-width: 500px;
margin: auto;
padding: 20px 30px 20px 30px;
background-color: #000;
box-shadow: 0px 1px 26px -3px #000;
font-family: 'IM Fell English', serif;
color: #FFF;
}
.lightbox .title {
margin: 0;
padding: 0 0 10px 0px;
border-bottom: 1px #ccc solid;
}
.lightbox .content {
display: block;
position: relative;
}
.lightbox .close {
display:block;
float:right;
margin-top: -10px;
text-decoration:none;
font-family: 'Helvetica', sans-serif;
font-size: 0.8em;
color: #FFF;
border: 1px solid #FFF;
padding: 0px 3px 2px 3px;
}
.lightbox #legend {
padding-bottom: 10px;
margin-top: -10px;
}
.clear {
display:block;
clear:both;
}
/* back and previous buttons */
.lightbox .next,
.lightbox .prev,
.lightbox .close {
display:block;
text-decoration:none;
}
.prev {
float:left;
color:#FFF;
padding-top: 12px;
}
.next {
float:right;
color:#FFF;
padding-top: 12px;
}
.close {
float:right;
}
.clear {
display:block;
clear:both;
}
<div id="GalleryContent">
<section id="gallery">
<section class="item">
<a href="#img1">
<img src="images/galerie/voltigeurs-1.jpg">
</a>
</section>
<section class="item">
<a href="#img2">
<img src="images/galerie/voltigeurs-2.jpg">
</a>
</section>
<section class="item">
<a href="#img3">
<img src="images/galerie/voltigeurs-3.jpg">
</a>
</section>
<section class="item">
<a href="#img4">
<img src="images/galerie/voltigeurs-4.jpg">
</a>
</section>
<section class="item">
<a href="#img5">
<img src="images/galerie/voltigeurs-5.jpg">
</a>
</section>
<section class="item">
<a href="#img6">
<img src="images/galerie/voltigeurs-6.jpg">
</a>
</section>
<section class="item">
<a href="#img7">
<img src="images/galerie/voltigeurs-7.jpg">
</a>
</section>
<section class="item">
<a href="#img8">
<img src="images/galerie/voltigeurs-8.jpg">
</a>
</section>
<section class="item">
<a href="#img9">
<img src="images/galerie/voltigeurs-9.jpg">
</a>
</section>
<section class="item">
<a href="#img10">
<img src="images/galerie/voltigeurs-10.jpg">
</a>
</section>
<section class="item">
<a href="#img11">
<img src="images/galerie/voltigeurs-11.jpg">
</a>
</section>
<section class="item">
<a href="#img12">
<img src="images/galerie/voltigeurs-12.jpg">
</a>
</section>
</section>
</div>
<!-- lightbox container hidden with CSS -->
<div class="lightbox" id="img1">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">1</div>
<div class="content">
<img src="images/galerie/voltigeurs-1.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img2"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img2">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">2</div>
<div class="content">
<img src="images/galerie/voltigeurs-2.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img1"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img3"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img3">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">3</div>
<div class="content">
<img src="images/galerie/voltigeurs-3.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img2"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img4"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img4">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">4</div>
<div class="content">
<img src="images/galerie/voltigeurs-4.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img3"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img5"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img5">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">5</div>
<div class="content">
<img src="images/galerie/voltigeurs-5.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img4"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img6"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img6">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">6</div>
<div class="content">
<img src="images/galerie/voltigeurs-6.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img5"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img7"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img7">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">7</div>
<div class="content">
<img src="images/galerie/voltigeurs-7.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img6"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img8"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img8">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">8</div>
<div class="content">
<img src="images/galerie/voltigeurs-8.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img7"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img9"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img9">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">9</div>
<div class="content">
<img src="images/galerie/voltigeurs-9.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img8"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img10"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img10">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">10</div>
<div class="content">
<img src="images/galerie/voltigeurs-10.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img9"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img11"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img11">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">11</div>
<div class="content">
<img src="images/galerie/voltigeurs-11.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img10"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img12"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
<div class="lightbox" id="img12">
<div class="box">
<a class="close" href="#">x</a>
<div id="legend">12</div>
<div class="content">
<img src="images/galerie/voltigeurs-12.jpg">
</div>
<!-- Previous Image Button -->
<a class="prev" href="#img11"><img src="images/hand_right_white.png" width="40px"></a>
<!-- Next Image Button -->
<a class="next" href="#img1"><img src="images/hand_left_white.png" width="40px"></a>
<div class="clear"></div>
</div>
</div>
Thanks a lot for your help.
May be you want something like this.
*{
margin:0;
padding:0;
}
#gallery{
border:1px solid red;
margin:auto;
width:500px;
padding:5px;
height:800px;
}
#thumbs{
width:150px;
height:150px;
border:1px solid green;
padding:5px;
float:left;
margin:5px;
}
#thumbs img{
width:100%;
height:100%;
}
.lightbox{
visibility:hidden;
opacity:0;
position:fixed;
top:0;
left:0;
background-color:rgba(72,73,74,1);
height:100%;
width:100%;
}
.lightbox:target{
visibility:visible;
opacity:1;
transition:opacity 2s;
}
#outer{
background-color:#FFF;
width:min-content;
height:400px;
margin:auto;
margin-top:30px;
box-shadow:0px 0px 35px #000000;
padding:10px;
}
#inner img{
max-height:500px;
max-width:800px;
}
.lightbox a{
text-decoration:none;
font-size:20px;
color:#666;
}
#cross{
float:right;
}
#next{
float:right;
}
<div id="gallery">
<div id="thumbs">
<img src="img1.jpg"/>
</div>
<div id="thumbs">
<img src="img2.jpg"/>
</div>
<div id="thumbs">
<img src="img3.jpg"/>
</div>
<div id="thumbs">
<img src="img4.jpg"/>
</div>
<div id="thumbs">
<img src="img5.jpg"/>
</div>
<div id="thumbs">
<img src="img6.jpg"/>
</div>
<div id="thumbs">
<img src="img7.jpg"/>
</div>
<div id="thumbs">
<img src="img8.jpg"/>
</div>
</div>
<div class="lightbox" id="lightbox1">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img1.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox2">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img2.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox3">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img3.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox4">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img4.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox5">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img5.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox6">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img6.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox7">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img7.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox7">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img7.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
<div class="lightbox" id="lightbox8">
<div id="outer">
<p id="title">Image
X</p>
<div id="inner">
<img src="img8.jpg"/>
</div>
<p>Next
Previous</p>
</div>
</div>
Please check this videos:- https://www.youtube.com/watch?v=q7ZhOczh35A & https://www.youtube.com/watch?v=82SwGTvM_DU

Hover image on top of another image

I'm trying to add some hover effect on some images I got.
<div id="horizontal_list">
<div class="grid_3 first overlay">
<a href="#">
<img border="0" alt="first" src="path">
</a>
</div>
<div class="grid_3 overlay">
<a href="#">
<img border="0" alt="first" src="path">
</a>
</div>
</div>
When I hover the div with the overlay class I want another image to hover on top of the imagetag..
I've got the following css:
#horizontal_list{
margin-top: 18px;
height: 330px;
}
.grid_3{
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
.first{
margin-left: 0px !important;
}
.last{
margin-right: 0px !important;
}
.overlay{
height: 330px;
}
.overlay:hover{
background: url('path') no-repeat;
}
I'm not sure what you mean by 'imagetag' but here is what I think you mean:
What you can do, is adding the second image in your html:
<div id="horizontal_list">
<div class="grid_3 first overlay">
<a href="#">
<img class="first_img" border="0" alt="first" src="path">
<img class="sec_img" border="0" alt="second" src="path">
</a>
</div>
<div class="grid_3 overlay">
<a href="#">
<img class="first_img" border="0" alt="first" src="path">
<img class="sec_img" border="0" alt="second" src="path">
</a>
</div>
</div>
And in your CSS:
.overlay {position: relative;}
.overlay:hover a img.sec_img {display: none;}
.overlay:hover a img.sec_img {
display: block;
position: absolute;
background: url(path) no-repeat;
top: 0;
left: 0;
width: [imgwidth]px;
height: [imgheight]px;
}
Be sure to change [imgwidth] and [imgheight] into the correct dimensions.
HTML
<div class="hoverholder">
<a href="#" class="picone">
<img src="#" alt="" />
</a>
<a href="#" class="pictwo">
<img src="#" alt="" />
</a>
</div>
CSS
.pictwo {display:none;}
.hoverholder:hover .picone{
display:none;
}
.hoverholder:hover .pictwo{
display:block;
}

Resources