/    Sign up×
Community /Pin to ProfileBookmark

Vertically Centering Image

I’m trying to vertically center this logo on my responsive navigation bar and keep its relative positioning. I have tried using the vertical-align and table-cell in different ways, but have not succeeded.

The image below shows that the logo is not vertically centered (not too obvious but you can still see a gap at the top where the 9 blobs are).

[IMG]http://oi57.tinypic.com/2am0wh.jpg[/IMG]

Please go to [url]http://www[/url][dot]acmfootball[dot]com/navs/nav1/ if you want to view or experiment with the code.

This is my CSS code at the moment that dictates the mobile navigation logo.

[code]#acmcentral {

display: block;
margin: 0 auto;
display:inline-table;
vertical-align:middle;

}

#acmcentral img {
display:table-cell;
vertical-align:middle;
/*height:28px;*/
}[/code]

Any help much appreciated for this small but annoying issue.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@nanohardFeb 04.2014 — You can try to wrap the image and text in a <div> and do a margin-top: -5px;
×

Success!

Help @supermessiah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...