Maison  >  Article  >  interface Web  >  <div>层怎么让背景水平垂直居中?_html/css_WEB-ITnose

<div>层怎么让背景水平垂直居中?_html/css_WEB-ITnose

WBOY
WBOYoriginal
2016-06-24 12:25:101064parcourir

HTML CSS

层怎么让背景水平垂直居中呢?
代码如下:
<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>

回复讨论(解决方案)

设置背景比较苛刻,可以用两层

valign:center  div中加这个

valign:center  div中加这个 别忘了来结贴啊

backgroud:url(./images/ft.gif)  center center no-repeat;
也就是背景图位置 background-postion:center center;

backgroud:url(./images/ft.gif)  center center no-repeat;
也就是背景图位置 background-postion:center center;

嗯,一时没想开,呵呵,已经解决啦。。
谢谢哈。。  

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn