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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Vertical alignment on image?

    Hello,

    This is my site and the problem: http://www.zoiology.com/category/blog/guides/

    Notice how the images aren't aligned very well. I'm trying to figure out how to align all the images in even rows and have the rows float based on the header size. I've been looking online for how to do this but haven't had a lot of luck, hoping someone here can help. Thanks!

    - Mark

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello swedy13,
    Your images are just bumping up against the bottom of your h2 and, since each h2 is a different height the images cannot line up.

    Add this bit and see how it changes -
    Code:
    h2 {
    	font-size:26px;
    	padding-top:30px;
    	font-weight:none;
    height: 120px;
    background: #f00;
    }
    As for changing the order your images are floated in based on their h2 size, you will probably need to rearrange your markup to do that.
    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

  • Users who have thanked Excavator for this post:

    swedy13 (01-12-2012)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Maybe this works for you instead?
    Code:
    .gallery .portfolioItem {
    	float:left;
    	width:300px;
    height: 350px;
    background: #f00;
    	margin-right:25px;
    	overflow:hidden;
    	margin-bottom:10px;
    }
    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

  • #4
    New Coder
    Join Date
    Jan 2012
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Umm, ok, did that. I really don't know much about coding, but I imagine that I can make the background clear?

    Also, I'd like to center the text rather than align left. And is there any way to get the text to automatically sit low (closest to the picture) rather than being centered vertically at the top of the 120px box?

    Thanks for the help!!

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts
    No, I liked the first one better. That way the images are aligned. The text just looks funky, but I think it would work if I could have it horizontally centered and start at the image and work up (rather than at the top of the box and work down).


  •  

    Tags for this Thread

    Posting Permissions

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