Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-12-2012, 04:16 PM   PM User | #1
swedy13
New Coder

 
Join Date: Jan 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
swedy13 is an unknown quantity at this point
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
swedy13 is offline   Reply With Quote
Old 01-12-2012, 04:28 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
swedy13 (01-12-2012)
Old 01-12-2012, 04:32 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Old 01-12-2012, 04:34 PM   PM User | #4
swedy13
New Coder

 
Join Date: Jan 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
swedy13 is an unknown quantity at this point
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!!
swedy13 is offline   Reply With Quote
Old 01-12-2012, 04:39 PM   PM User | #5
swedy13
New Coder

 
Join Date: Jan 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
swedy13 is an unknown quantity at this point
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).
swedy13 is offline   Reply With Quote
Reply

Bookmarks

Tags
align, center, float, image, vertical

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:01 AM.


Advertisement
Log in to turn off these ads.