Solved

CSS gallery

Posted on 2014-12-29
4
111 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can I add blockquote after on my wordpress site 3 17
alert(innerHTML); 8 32
REST endpoint query with a parameter 1 18
Html Newline 7 21
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 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