Solved

CSS gallery

Posted on 2014-12-29
4
109 Views
Last Modified: 2014-12-31
Hi all,

Can somebody help me this one http://m5designstudio.com/2010/css/simple-css-gallery-image-text-rollover/.

I like a holder/default image instead of the white blank space, thumbnail pictures moved to the bottom with 14 spaces for images in two rows.

Same images can be used for all the spaces.

Thanks,

Ilyas
0
Comment
Question by:muvend
  • 2
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 500 total points
ID: 40522050
Hi muvend.
Here the working code:
<!DOCTYPE HTML>
<html>
	<head>
		<title></title>
		<style type="text/css">
			/*<![CDATA[*/
			#gallery_container {
				background-color: #99CC99; 
				height: 650px; 
				width: 800px; 
				padding:10px; 
				margin: auto; 
				position: relative; 
			} 
			/* Drak Grey container that holds gallery */ 
			#simple_gallery { 
				background-color: #333333; 
				height: 530px; 
				width: 515px; 
				position:relative; 
				margin: auto; 
			}
			#simple_gallery img {
				border: 5px solid #FFFFFF;
			} 
			/* Thumbnails styles */ 
			.simple_thumbnails { 
				margin:5px; 
				float:left; 
			} 
			/* Large rollover image styles */
			#simple_gallery span img {
				margin-bottom: 10px 
			} 
			#simple_gallery span{ 
				visibility:hidden; 
				position:absolute; 
				top:120px; 
				color:#FFFFFF; 
				font-size:12px; 
				width:435px; 
				left:-1000px; /* prevents the browser to show scroll bar at bottom*/
			} 
			#simple_gallery a span.first{ 
				visibility: visible; 
				position:absolute; 
				left: 30px; /*position where enlarged image is placed horizontally */
				top:120px; 
				z-index: 50; 
				color:#FFFFFF; 
			} 
			#simple_gallery a:link span.first {
				color:#FFFFFF; 
				text-decoration: none; 
				visibility:visible; 
			} 
			#simple_gallery a:visited span.first {
				text-decoration: none; 
				color:#FFFFFF; 
				visibility:visible;
			} 
			#simple_gallery a:link span {
				color:#FFFFFF; 
				text-decoration: none; 
				visibility:hidden; 
			} 
			#simple_gallery a:visited span {
				text-decoration: none; 
				color:#FFFFFF; 
				visibility:hidden; 
			} 
			#simple_gallery a:hover span{
				/*CSS for enlarged image*/ 
				visibility: visible; 
				position:absolute; 
				left: 30px; /*position where enlarged image is placed horizontally */
				top:120px; 
				z-index: 50; 
				color:#FFFFFF; 
			} 
			#simple_gallery a:active span { 
				text-decoration: none; 
				color:#FFFFFF; 
				visibility:hidden; 
			}
			/*]]>*/
		</style>
	</head>

	<body>
		<div id="simple_gallery"> 
			<a href="#"> 
				<img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_1.jpg" width="108" height="86" class="simple_thumbnails" />
				<span class="first"><img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_1.jpg" /><br />
					IMAGE ONE: Lorem ipsum dolor sit amet, consectetur adiscing elit. In ut ligula. Fusce risus diam, dapibus eget, ullamcorper eu. 
				</span>
			</a> 
			<a href="#">
				<img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_2.jpg" width="108" height="86" class="simple_thumbnails" />
				<span>
					<img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_2.jpg" /><br />
					IMAGE TWO:Lorem ipsum dolor sit amet, consectetur adiscing elit. In ut ligula. Fusce risus diam, dapibus eget, ullamcorper eu.
				</span>
			</a> 
			<a href="#"> 
				<img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_3.jpg" width="108" height="86" class="simple_thumbnails" />
				<span>
					<img src="http://www.davidwightman.net/_images_landscape/Behemot/Behemot_detail_3.jpg" /><br />
					IMAGE THREE:Lorem ipsum dolor sit amet, consectetur adiscing elit. In ut ligula. Fusce risus diam, dapibus eget, ullamcorper eu.
				</span>
			</a> 
<!--			<a href="#"> 
				<img src="images/four_s.jpg" width="108" height="86" class="simple_thumbnails" />
				<span>
					<img src="images/four.jpg" /><br />
					IMAGE FOUR:Lorem ipsum dolor sit amet, consectetur adiscing elit. In ut ligula. Fusce risus diam, dapibus eget, ullamcorper eu.
				</span>
			</a> -->
		</div>
	</body>
</html>

Open in new window

The trick is to create a class called .first and give it to the first span: the only difference with the span rules is the visibility and the left properties.

I didn't adjut the container width to the image linked, but I'm sure you don't need help for this :-)

Cheers
0
 

Author Closing Comment

by:muvend
ID: 40525363
Thank you very much Marco.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 40525384
Glad to help you muvend. Happy New Year and thanks for points!
0
 

Author Comment

by:muvend
ID: 40525462
Thanks for your help. I wish you a happy 2015 Marco.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now