Home >Web Front-end >HTML Tutorial >How to center the background of
HTML CSS
dc6dce4a544fdca2df29d5ac0ea9906b How to center the background horizontally and vertically?<style>.ft_br{ width:1190px; height:250px; margin:0 auto; padding:0; backgroud:url(./images/ft.gif) no-repeat;/* 背景图片的尺寸是160px*50px的*/}</style><div class="ft_br"></div>
Setting the background is more demanding, you can use two layers of
valign: Add this to center div
valign: Add this to center div and don’t forget to tie it
backgroud:url(./images/ft.gif) center center no-repeat;
That is, the background-postion:center center;
backgroud:url(./images/ft.gif) center center no-repeat;
That is the background-postion: center center;
Well, I didn’t think about it for a moment, haha, it’s been solved. .
Thank you. .