Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8364089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:20:56+00:00 2026-06-09T12:20:56+00:00

I am able to align image in middle vertically inside DIV when i do

  • 0

I am able to align image in middle vertically inside DIV when i do it on jsFiddle but same is not working when i do it on the website it seems it is conflicting with some CSS which i am not able to locate.

I am using the same CSS which i used for the jsFiddle example, On actual website logo always come aligned at top position.

I would appreciate help in this regarding.

Solution

<script type="text/javascript">
    $(document).ready(function () {
        var h = $("#BannerSlider").height();
        $.map($("#BannerSlider img"), function (e) {
            var top = (h - $(e).height()) / 2;
            $(e).css("margin-top", top);
        });
    });
</script> 
    <title></title>
    <style>
.SponsorLogos
{
    width:600px;
    margin-top:50px;
    margin-left:60px;
    min-height:550px;
    background:red;
}
.SponsorLogoWrapper
{
    width:160px;
    height:160px;
    margin-right:30px;
    margin-bottom:30px;
    border:1px solid #78AC1B;
    line-height:160px;
    text-align:center;
    overflow:hidden;
    float:left;

}
.SponsorLogoWrapper img
{
    display: inline-block;
    border:0px;
}

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <div class="SponsorLogos">

          <div id="BannerSlider" class="SponsorLogoWrapper" >
               <img src="http://www.nikolakis.net/liquidcarousel/images/01.jpg" width="88" height="126" alt="image"/>
               </div>
         <div id="BannerSlider" class="SponsorLogoWrapper" >
                <img src="http://www.nikolakis.net/liquidcarousel/images/02.jpg" width="88" height="110" alt="image" />
                 </div>
        <div id="BannerSlider" class="SponsorLogoWrapper" >
                <img src="http://www.nikolakis.net/liquidcarousel/images/03.jpg" width="88" height="100" alt="image"/>
                       </div>
         <div id="BannerSlider" class="SponsorLogoWrapper" >
                <img src="http://www.nikolakis.net/liquidcarousel/images/04.jpg" width="88" height="126" alt="image"/>
                       </div>
        <div id="BannerSlider" class="SponsorLogoWrapper" >
                <img src="http://www.nikolakis.net/liquidcarousel/images/05.jpg" width="88" height="90" alt="image"/>
           </div>
</div>

    </div>
    </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:20:57+00:00Added an answer on June 9, 2026 at 12:20 pm

    If you switch the jsFiddle DOCTYPE to match your websites the images align to the top again (you can do this in the info panel on the left).

    With that in mind you could check this answer: Vertical-align not working with XHTML 1.0 Transitional doctype?

    Response to first comment

    Well the easiest thing to do would be to change the DOCTYPE.
    If you can’t do that then you need to find another method entirely. Vertical align works best with tables so you could change the display props to be table based. Here is an example: http://jsfiddle.net/64UnS/1/

    I don’t know if you’ll be able to implement this – browser support varies. Of course you are using display: inline-block; already and I didn’t see an IE7 fallback so maybe this is fine for you.

    Other options could include:

    • making your images 160 x 160px
    • changing the markup so that the each image is output as a
      background-image inline on the <a /> tag. This is then easy to
      center (of course you’ll need to be sure of your image dimensions –
      background-size support is even less well supported)
    • using a javascript solution (I see you hav jQuery in the <head />
      already)

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not able to align textbox and Input Button control on an asp.net
I am not able to understand how to rotate the image. I am trying
I have some some rows of image thumbs inside anchors inside a div, one
I am setting an image as a background inside a DIV and and want
Hi I want to place a Image which is center align vertically and horizontally
everyone. I'm trying to give a text link a background image but I'm not
Must be very simple to solve but I'm not able to solve this. I
Not able to download artifacts from central maven repository. <mirrors> <!-- mirror | Specifies
Not able to store all binary data values into sqlite3 table using QT. For
not able to get this, can someone help for this LINQ query? select col1,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.