Home  >  Article  >  Web Front-end  >  How to set the src of img in css

How to set the src of img in css

藏色散人
藏色散人Original
2021-02-24 11:09:526149browse

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>

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!

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