Note that there are some explanatory texts on larger screens.

plurals
  1. POImage not aligning inside div
    primarykey
    data
    text
    <p>I am able to align image in middle vertically inside <code>DIV</code> when i do it on <a href="http://jsfiddle.net/QHEnL/187/" rel="nofollow">jsFiddle</a> 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.</p> <p>I am using the same CSS which i used for the jsFiddle <a href="http://jsfiddle.net/QHEnL/187/" rel="nofollow">example</a>, On actual website logo always come aligned at top position.</p> <p>I would appreciate help in this regarding.</p> <p><strong>Solution</strong></p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { var h = $("#BannerSlider").height(); $.map($("#BannerSlider img"), function (e) { var top = (h - $(e).height()) / 2; $(e).css("margin-top", top); }); }); &lt;/script&gt; &lt;title&gt;&lt;/title&gt; &lt;style&gt; .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; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;div class="SponsorLogos"&gt; &lt;div id="BannerSlider" class="SponsorLogoWrapper" &gt; &lt;img src="http://www.nikolakis.net/liquidcarousel/images/01.jpg" width="88" height="126" alt="image"/&gt; &lt;/div&gt; &lt;div id="BannerSlider" class="SponsorLogoWrapper" &gt; &lt;img src="http://www.nikolakis.net/liquidcarousel/images/02.jpg" width="88" height="110" alt="image" /&gt; &lt;/div&gt; &lt;div id="BannerSlider" class="SponsorLogoWrapper" &gt; &lt;img src="http://www.nikolakis.net/liquidcarousel/images/03.jpg" width="88" height="100" alt="image"/&gt; &lt;/div&gt; &lt;div id="BannerSlider" class="SponsorLogoWrapper" &gt; &lt;img src="http://www.nikolakis.net/liquidcarousel/images/04.jpg" width="88" height="126" alt="image"/&gt; &lt;/div&gt; &lt;div id="BannerSlider" class="SponsorLogoWrapper" &gt; &lt;img src="http://www.nikolakis.net/liquidcarousel/images/05.jpg" width="88" height="90" alt="image"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload