html设置图片不滚动的方法:首先新建一个html示例文件;然后在index.html中的标签中输入代码为“background-repeat:no-repeat;”即可。</p></blockquote> <p><img src="https://img.php.cn/upload/article/202104/01/2021040113595391654.jpg" alt="html图片不滚动怎么设置" ></p> <p>本文操作环境:Windows7系统、HTML5&&CSS3版,DELL G3电脑</p> <p>1、首先,打开html编辑器,新建html文件,例如:index.html,编写问题基础代码。</p> <p><img src="https://img.php.cn/upload/image/494/233/954/1617256941324646.png" title="1617256941324646.png" alt="857025344308ce1a549a8826ca89fe6.png"></p> <p>2、在index.html中的<script>标签,输入js代码:style="background-image:url(image.jpg);background-repeat:no-repeat;background-attachment:fixed"。</p> <p><img src="https://img.php.cn/upload/image/361/993/925/1617256946656477.png" title="1617256946656477.png" alt="505c1351145883f90ff5d80b03e35f6.png"></p> <p>3、浏览器运行index.html页面,此时滚条拉动,页面内容能动,背景图片不动。</p> <p><img src="https://img.php.cn/upload/image/155/608/278/1617256950771870.png" title="1617256950771870.png" alt="bd866352a1310ddc53795199c4c418d.png"></p> <p>【推荐学习:<a href="https://www.php.cn/course/list/11.html" target="_blank">HTML视频教程</a>】</p>