Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Vertical Alignment in <li> elements

    I'm using an unordered list to create a pseudo-table that will have different amounts of cells per row based on the browser window size. Since I want to use the "table" as an image gallery, I'd like the images to be centered vertically in the "cells". I have tried this (http://www.jakpsatweb.cz/css/css-ver...-solution.html) method with no luck. If anyone is able to figure this out or another way I could get the same results using a different method it would be much appreciated.

    The page can be found here: http://activities.fit.edu/aiaa/Test/...ate/photos.htm

    The CSS for the image gallery is:

    Code:
    #pics {
    	display: table;
    	width: 97%;
    	padding: 0 auto 0 auto;
    	margin: 10px auto 10px auto;
    	border: 2px solid #C8CDD2;
    }
    #pics ul {
    	padding: 0;
    	list-style: none;
    }
    #pics li {
    	float: left;
    	width: 160px;
    	height: 160px;
    	margin: 2px;
    	border: 1px solid #CCCCCC;
    }
    #pics a img {
    	display: block;
    	border: none;
    	margin-left: auto;
    	margin-right: auto;
    	background: #CCFF00;
    }
    Thanks a lot

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    Goodmorning NewbNeedHelp,
    Your site is a perfect candidate for an image presentation project I have been working on. Have a look at this.

    The more pics you add the better you'll appreciate what it's doing.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's pretty much exactly what I wanted to do. Although I'm partial to lists, the coding you use is still extremely simple. Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •