Home  >  Article  >  Web Front-end  >  What is the method to introduce local images in css

What is the method to introduce local images in css

王林
王林Original
2021-02-24 16:05:278984browse

How to introduce local images in css: You can use the background attribute, such as [background:url(images/2.jpg) no-repeat;]. The background property sets all background properties in one statement.

What is the method to introduce local images in css

The operating environment of this article: windows10 system, css3, thinkpad t480 computer.

Attribute introduction:

background is a shorthand attribute, which can set all background attributes in one statement.

You can set the following properties:

  • background-color

  • ##background-position

  • background-size

  • background-repeat

  • background-origin

  • background- clip

  • background-attachment

  • background-image

Specific method:


What is the method to introduce local images in css

Run results:

What is the method to introduce local images in css

Related recommendations:

CSS tutorial

The above is the detailed content of What is the method to introduce local images in 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