Solved

CSS gallery

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

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 30

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
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 look for a specific file type in a local or remote server directory using PHP.
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 …

758 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

21 Experts available now in Live!

Get 1:1 Help Now