tag in index.html."/> tag in index.html.">

Home  >  Article  >  Web Front-end  >  How to set html images not to scroll

How to set html images not to scroll

藏色散人
藏色散人Original
2021-04-01 14:05:007178browse

htmlHow to set the image not to scroll: First create a new html sample file; then enter the code "background-repeat:no-repeat;" in the <script> tag in index.html. </script>

How to set html images not to scroll

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer

1. First, open the html editor and create a new html file. For example: index.html, write the basic code of the problem.

How to set html images not to scroll

2. In the <script> tag in index.html, enter the js code: style="background-image:url(image.jpg);background-repeat :no-repeat;background-attachment:fixed". </script>

How to set html images not to scroll

#3. The browser runs the index.html page. At this time, the scroll bar is pulled, the page content can move, and the background image does not move.

How to set html images not to scroll

[Recommended learning: HTML video tutorial]

The above is the detailed content of How to set html images not to scroll. 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