Home > Web Front-end > HTML Tutorial > How to center the background of
layer horizontally and vertically?_html/css_WEB-ITnose

How to center the background of
layer horizontally and vertically?_html/css_WEB-ITnose

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

HTML CSS

How to center the background horizontally and vertically?
The code is as follows:
<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

Reply to discussion (solution)

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. .

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