HTML CSS examples for CSS Widget:Table Row
Vertically center aligned image in a table row
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> * {<!--from ww w.j av a2s .c om--> padding:0; margin:0; } body { padding:21px; } .ctn { width:100%; text-align:center; } .img-ctn { display:inline; margin-right:4%; max-width:121px; background:Chartreuse; font-size:0; } .img-ctn>img { max-width:100%; vertical-align:middle; } </style> </head> <body> <div class="ctn"> <p class="img-ctn"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </p> <p class="img-ctn"> <img src="https://www.java2s.com/style/demo/Firefox.png" alt=""> </p> <p class="img-ctn"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </p> <p class="img-ctn"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </p> <p class="img-ctn"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> </p> </div> </body> </html>