开发者

Html 5 horizontal and vertical align img inside figure

开发者 https://www.devze.com 2023-01-16 07:47 出处:网络
Hi can someone help me horizontal and vertical align a img inside a figure <figure class=\"frontpagearticlefigure\">

Hi can someone help me horizontal and vertical align a img inside a figure

 <figure class="frontpagearticlefigure">
    <img class="frontpagearticleimg" src="image.png" alt="image" title="imgtitle" />
</figure> 

and my css

.frontpagearticlefigure
{
    display: block;
    height: 140px;
    width: 250px; 
}

Im working w开发者_JAVA百科ith html 5


You can try using .frontpagearticlefigure img { display: inline-block; vertical-align: middle; } or use display: table-cell

0

精彩评论

暂无评论...
验证码 换一张
取 消