Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Art & Graphic Design > Vertically-Centered Images :(

Vertically-Centered Images :(
Thread Tools
l008com
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Dec 11, 2010, 08:42 PM
 
I made a quick example page (css in the head) that shows 3 basic situations where images are not aligned properly (vertically). Many people have different ideas for how to handle these but I'm not really a big fan of any ideas I've heard so far. Is there no way in CSS to just "nudge" an image down, or up, without effecting it's container? Also note that the Login button isn't in standard image, it's a form input element.

Vertically Align Images

I'm not thrilled with using span's with background images, in place of regular <img>'s, but if that's the only way to do it... so be it. But that hack won't work on my form button.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Dec 11, 2010, 10:45 PM
 
There is a way...

position:relative
top:5px

or

position:relative
top:-5px

background images and background position are semantically better for this sort of thing though, since the images are a part of the template, not the actual page content. Why are you against background images?
     
andi*pandi
Moderator
Join Date: Jun 2000
Location: inside 128, north of 90
Status: Offline
Reply With Quote
Dec 15, 2010, 11:01 AM
 
looks like you solved it!
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Dec 15, 2010, 11:40 AM
 
Looks good! I see why you didn't want to use background images for the Humm-Dingers nav item!
     
l008com  (op)
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Dec 15, 2010, 02:40 PM
 
Yup, besson3c's way worked very well.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 01:52 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,