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

WBOY
Release: 2016-06-24 12:25:10
Original
1063 people have browsed it

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>
Copy after login

回复讨论(解决方案)

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

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;

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!