Solved

CSS gallery

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

770 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