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

How to resize background image using CSS

王林
王林Original
2020-11-12 13:51:382738browse

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;

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;
}

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!

Statement:
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
Previous article:What technology is css3Next article:What technology is css3