Home > Web Front-end > CSS Tutorial > How to resize background image using CSS

How to resize background image using CSS

王林
Release: 2020-11-12 13:51:38
Original
2736 people have browsed it

How to use CSS to adjust the size of the background image: You can use the background-size attribute to adjust, such as [background-size:80px 60px;]. The backgrond-size attribute specifies the size of the background image.

How to resize background image using CSS

Attribute introduction:

The background-size attribute specifies the size of the background image.

(Learning video sharing: css video tutorial)

Grammar:

background-size: length|percentage|cover|contain;
Copy after login

Attribute value introduction:

How to resize background image using CSS

Example:

div
{
background:url(img_flwr.gif);
background-size:80px 60px;
background-repeat:no-repeat;
}
Copy after login

Related recommendations:CSS tutorial

The above is the detailed content of How to resize background image using CSS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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