Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Css Based Photo Gallery Code, Fluid design for layout
jlhaslip
post Jan 18 2006, 01:34 AM
Post #1


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,005
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



Fluid Design Photo Gallery

There are quite a few Topics here on the Trap17 Forum about how to set-up and use Photo Galleries and about the link code for getting from a Thumbnail Image to a full size Image and all that stuff, so I would like to take this "Photo Gallery" concept one step further without covering what others have already supplied instruction for. Usually, when there is a solution posted here for the code on "how-to-do-this", there are tables involved and the Links are placed inside Table cells.

Tables are not neccesarilly a bad thing, but they were not originally intended to be used as structural elements in html or on the web. So here is an example of a Gallery which does not use Tables: Gallery link

The trick is in the CSS code used for the layout of the list of links. For those of you who understand CSS, there will be little need for an explanation. For those of you just learning, here is an explanation.

The CSS and comments:
HTML
#imagelist {
list-style-type: none; // removes the list images from the li's
}
#imagelist li {
float: left; // floats the li to the left with margins as follows
margin-right: 6px;
margin-bottom: 10px;
padding-bottom:6 px;
font: bold 0.8em Arial, Helvetica, sans-serif; // set font information as a single line
color: #333333; //forecolour is set here
}
#imagelist img {
display: block; // display as block so the description is below the Image
border: 1px solid #333300; // sets border size, shape and colour
}


When you view the file, notice how the image layout changes to accomodate the window width? and no Horizontal scroll bar?
Size the thumbnails according to the size and shape of the full sized pictures, unless you like distortion.

So maybe now we will see fewer Table-based Photo Gallery designs?

Tested in FF, Opera8, IE5 and IE5 iMac

I hope this is helpful.
Go to the top of the page
 
+Quote Post
Tyssen
post Jan 18 2006, 06:46 AM
Post #2



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



It looks nice and neat at the moment cos your images are all the same size, but you may want to give your <li>s a height & width when you start adding images of different shapes.
Go to the top of the page
 
+Quote Post
Dragonfly
post Jan 18 2006, 08:26 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 702
Joined: 17-February 05
Member No.: 3,817



That is cool because it will fit to all kinds of screen resolution and monitor resolution visitors are using. The pictures will just slip down when more pictures cannot be viewed in the same row, otherwise if one uses table it will give horizontal bar which I really dont' like. The only problem with the CSS based photogallery of yours is the size of the pictures, one may want to alter the size of the pictures according to the sources..
Go to the top of the page
 
+Quote Post
Avalon
post Jan 18 2006, 12:26 PM
Post #4


Privileged Member
*********

Group: Members
Posts: 630
Joined: 12-August 05
From: Melbourne, Australia
Member No.: 10,624



QUOTE(Tyssen @ Jan 18 2006, 05:46 PM)
It looks nice and neat at the moment cos your images are all the same size, but you may want to give your <li>s a height & width when you start adding images of different shapes.
*


Yes, once you start using different size thumbnails it will start to look messy. I think you will need to set the li element size to something bigger than your largest thumbnail. If you do this, will it run the risk of showing the dreaded horizontal scroll bar if viewed at different screen resolutions? I guess you could resize the thumbnails to a set width and let the height of the thumbnail be determined by the size ratio of the image, this will still look a little messy I think.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Put A Phpbb Login Box On Your Main Site.(18)
  2. Jalbum 5.2(0)
  3. Css And Javascript Combined For Dynamic Layout(9)
  4. Handy Javascript Code Snips(5)
  5. Php Navigation(7)
  6. Php Spy Code(21)
  7. Uploading Images To The Trap17 Gallery(4)
  8. Beginner's Guide To Skiing(4)
  9. Your First Autoit(4)
  10. Image Gallery Tutorial Using Hoverbox(14)
  11. How To Make A Simple File Based Shoutbox Using Php And Html(8)
  12. Css-based "i-frames" (sort Of)(1)
  13. Do You Want To Use Php Code In Your Html Pages?(9)
  14. Making a java based program(3)
  15. Faux Ajax Loading - Css Only(3)
  1. Background Image Swap Script(15)
  2. Nice Clean Php Layout Coding.(7)
  3. [php] Clean Code Functions(5)
  4. Make A Flat Based Shoutbox, With Auto Refresh.(6)
  5. Add Flashing Inbox To Invisionfree Forum(2)
  6. How To Install Opengeu In Ubuntu(0)
  7. Create Dynamic Html/php Pages Using Simple Vb.net Code(1)


 



- Lo-Fi Version Time is now: 8th September 2008 - 09:18 AM