Home > Web Front-end > Front-end Q&A > How to set the src of img in css

How to set the src of img in css

藏色散人
Release: 2023-01-03 09:25:02
Original
6204 people have browsed it

How to set the src of img in css: First create an HTML sample file; then define the src of img by setting the css code to "img{content:url(https://image.png);}" That’s it.

How to set the src of img in css

# The operating environment of this tutorial: windows7 system, CSS3 version, Dell G3 computer.

You can use the content attribute of CSS. The attribute information is as follows:


How to set the src of img in css The definition code is as follows: [Recommended:
css video tutorial]

<style>
    img {
  		  content:url(https://image.png);
   		 }
</style>
Copy after login

The above is the detailed content of How to set the src of img in css. For more information, please follow other related articles on the PHP Chinese website!

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