澄梦希喜广告网站制作遂宁站

css中如何实现背景不滚动-创新互联

这篇文章将为大家详细讲解有关css中如何实现背景不滚动,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:主机域名、虚拟空间、营销软件、网站建设、三山网站维护、网站推广。

css背景不滚动的实现方法:首先新建一个html代码页面;然后在标签后面创建一个<style>标签;接着在这个标签里设置<body>标签的背景图片;最后设置“background-repeat:no-repeat;”属性即可。</p></blockquote><p>打开html开发软件,新建一个html代码页面。</p><p><img src="/upload/otherpic9/3189.jpg" alt="css中如何实现背景不滚动"></p><p>在html代码页面的<body>标签里面输入多行段落文字,用于后面浏览器滚动条滚动的时候查看图片时候随滚动条而滚动条。如图</p><p><img src="/upload/otherpic9/3190.jpg" alt="css中如何实现背景不滚动"></p><p>设置背景图片样式。在<title>标签后面创建一个<style>标签,然后在这个标签里设置<body>标签的背景图片,以及背景图片不重复。'</p><p>样式代码:</p><pre>body{ background-image: url(img/bg.jpg); background-repeat:no-repeat; }</pre><p><img src="/upload/otherpic9/3191.jpg" alt="css中如何实现背景不滚动"></p><p>保存html代码后使用浏览器打开,这个时候滚动浏览器滚动条发现背景图片是随浏览器滚动条的滚动而滚动的。</p><p><img src="/upload/otherpic9/3192.jpg" alt="css中如何实现背景不滚动"></p><p>使用background-attachment: fixed设置背景图片不随滚动条而滚动。回到html代码页面,在body样式中添加上background-attachment: fixed即可。</p><p>如图</p><p><img src="/upload/otherpic9/3193.jpg" alt="css中如何实现背景不滚动"></p><p>保存html代码页面后刷新浏览器,这个时候滚动浏览器滚动条发现背景图片已经固定不随浏览器滚动而滚动了。如图</p><p><img src="/upload/otherpic9/3194.jpg" alt="css中如何实现背景不滚动"></p><p>关于css中如何实现背景不滚动就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。</p> <br> 网站栏目:css中如何实现背景不滚动-创新互联 <br> 当前URL:<a href="http://www.hfanp.com/article/ddisph.html">http://www.hfanp.com/article/ddisph.html</a> </div> </div> </div> <div class="other container"> <h3>其他资讯</h3> <ul> <li> <a href="/article/dcopig.html">nagios监控网络流量-创新互联</a> </li><li> <a href="/article/sgdhod.html">短视频运营途径</a> </li><li> <a href="/article/epgpgc.html">3d建模基础入门教程,三d建模哪里能学</a> </li><li> <a href="/article/hedchd.html">php实现分页选择数据,MySQL实现数据分页</a> </li><li> <a href="/article/dsieijs.html">ios敏捷开发是什么,精通iOS开发</a> </li><li> <a href="/article/dgeisde.html">jquery祖先级 jquery获取祖先元素</a> </li><li> <a href="/article/dgijggh.html">电脑罗马数字输入快捷键 罗马数字在电脑键盘上怎么打</a> </li><li> <a href="/article/dghopdd.html">goland调试技巧如何快速诊断和解决问题</a> </li><li> <a href="/article/dghihdh.html">怎么屏蔽百度已收录的不必要二级目录</a> </li><li> <a href="/article/cdipsic.html">c语言指针怎么表示什么</a> </li> </ul> </div> <div class="footer"> <div class="foota container"> <div class="foot_nav fl col-lg-8 col-md-8 col-sm-12 col-xs-12"> <ul> <li class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>网站制作</h3> <a href="https://www.cdcxhl.com/mobile.html" target="_blank">手机网站制作设计</a><a href="http://www.kswcd.com/mobile/" target="_blank">手机网站制作</a><a href="http://www.cxhljz.cn/" target="_blank">成都网站制作</a><a href="http://www.wjwzjz.com/" target="_blank">温江网站制作</a><a href="http://www.wenjiangwz.cn/" target="_blank">成都网站制作</a><a href="http://m.cdcxhl.cn/mobile/" target="_blank">手机网站制作</a> </li> <li class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>企业服务</h3> <a href="https://www.cdcxhl.com/link/" target="_blank">友情链接购买</a><a href="https://www.cdcxhl.com/shoulu/" target="_blank">分类目录网站</a><a href="https://www.cdcxhl.com/service/ssl.html" target="_blank">ssl证书</a><a href="https://www.cdcxhl.com/service/ypfwzgz.html" target="_blank">互联网药品信息服务资格证</a><a href="https://www.cdcxhl.com/ruanwen/yingxiao/" target="_blank">软文发布平台</a><a href="https://www.cdcxhl.com/mianfei/zuo/chengdu.html" target="_blank">免费做网站</a> </li> <li class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>网站建设</h3> <a href="http://chengdu.cdcxhl.cn/seo/" target="_blank">营销网站建设</a><a href="https://www.cdxwcx.com/city/guanghan/" target="_blank">广汉网站建设</a><a href="http://m.cdcxhl.cn/qiye/" target="_blank">成都企业网站建设</a><a href="http://www.cxhlcq.com/mobile/" target="_blank">重庆手机网站建设</a><a href="http://www.cdkjz.cn/fangan/" target="_blank">网站建设方案</a><a href="http://chengdu.cdcxhl.com/" target="_blank">成都网站建设</a> </li> <li class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>服务器托管</h3> <a href="http://www.cdxwcx.cn/tuoguan/mianyang.html" target="_blank">绵阳托管服务器</a><a href="https://www.cdcxhl.com/cqtuoguan.html" target="_blank">重庆服务器托管</a><a href="https://www.cdcxhl.com/idc/xixin.html" target="_blank">西信服务器托管</a><a href="https://www.cdcxhl.com/idc/ershu.html" target="_blank">二枢服务器托管</a><a href="http://www.cdxwcx.cn/tuoguan/mianyang.html" target="_blank">绵阳机房托管</a><a href="https://www.cdcxhl.com/idc/meishan.html" target="_blank">眉山服务器托管</a> </li> </ul> </div> <div class="footar fl col-lg-4 col-md-4 col-sm-12 col-xs-12"> <p>全国免费咨询:</p> <b>400-028-6601</b> <p>业务咨询:028-86922220 / 13518219792</p> <p>节假值班:18980820575 / 13518219792</p> <p>联系地址:四川省遂宁市船山区德水北路56号</p> </div> </div> <div class="footb"> <div class="copy container"> <div class="fl">Copyright © 四川澄梦希喜广告有限公司 <a href="https://beian.miit.gov.cn/" target="_blank">蜀ICP备2025175960号-6</a></div> <!--<div class="fr"><a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a>:<a href="https://www.cdcxhl.com/" target="_blank">澄梦希喜</a></div>--> </div> </div> <div class="link"> <div class="container"> 友情链接: <a href="https://www.cdcxhl.com/" target="_blank">成都网站建设</a> <a href="https://www.cdcxhl.com/city/suining.html" target="_blank">遂宁网站建设</a> <a href="https://www.cdcxhl.com/idc/meishan.html">眉山服务器托管</a> <a href="https://www.cdcxhl.com/paiming/suining.html">遂宁seo排名</a> <a href="https://www.cdxwcx.com/jifang/xiyun.html" target="_blank">移动服务器托管</a> <a href="http://www.cdfuwuqi.com/" target="_blank">成都服务器托管</a> <a href="https://www.cdcxhl.cn/" target="_blank">云服务器</a> <a href="http://www.cdhuace.com/" target="_blank">广告设计制作</a> <a href="https://www.cdcxhl.com/sheji/suining.html" target="_blank">遂宁网页设计</a> <a href="https://www.cdcxhl.com/zuo/suining.html" target="_blank">遂宁做网站</a> <a href="https://www.cdcxhl.com/zhizuo/suining.html" target="_blank">遂宁网站制作</a> <a href="https://www.cdcxhl.com/seo/suining.html">遂宁网站推广</a> <a href="https://www.cdcxhl.com/idc/deyang.html">德阳服务器托管</a> <a href="https://www.cdcxhl.com/zuyong/meishan.html">眉山服务器租用</a> <a href="https://www.cdcxhl.com/tuoguan/">成都服务器托管</a> </div> </div> </div> <div class="foot"> <ul class="public-celan"> <li> <a href="#" target="_blank" class="a1 db tc"> <img src="/Public/Home/img/icon-23.png" alt="" class="db auto"> <span class="span-txt">在线咨询</span> </a> </li> <li> <a href="tel:18980820575" class="a1 db tc"> <img src="/Public/Home/img/icon-24.png" alt="" class="db auto"> <span class="span-txt">电话咨询</span> </a> </li> <li> <a target="_blank" href="tencent://message/?uin=1683211881&Site=&Menu=yes" class="a1 db tc"> <img src="/Public/Home/img/icon-25.png" alt="" class="db auto"> <span class="span-txt">QQ咨询</span> </a> </li> <li> <a target="_blank" href="tencent://message/?uin=532337155&Site=&Menu=yes" class="a1 db tc public-yuyue-up"> <img src="/Public/Home/img/icon-26.png" alt="" class="db auto"> <span class="span-txt">预约顾问</span> </a> </li> </ul> </div> <div class="customer"> <dl class="icon1"> <dt> <a href="tencent://message/?uin=1683211881&Site=&Menu=yes"> <i class="iconT"><img src="/Public/Home/img/QQ.png" alt=""></i> <p>在线咨询</p> </a> </dt> </dl> <dl class="icon2"> <dt><i><img src="/Public/Home/img/weixin.png" alt=""></i><p>微信咨询</p></dt> <dd><img src="/Public/Home/img/ewm.png"></dd> </dl> <dl class="icon3"> <dt><i><img src="/Public/Home/img/dianhua.png" alt=""></i><p>电话咨询</p></dt> <dd> <p>028-86922220(工作日)</p> <p>18980820575(7×24)</p> </dd> </dl> <dl class="icon4"> <dt class="sShow"> <a href="tencent://message/?uin=244261566&Site=&Menu=yes"> <i><img src="/Public/Home/img/dengji.png" alt=""></i><p>提交需求</p> </a> </dt> </dl> <dl class="icon5"> <dt class="gotop"> <a href="#top"> <i><img src="/Public/Home/img/top.png" alt=""></i><p>返回顶部</p> </a> </dt> </dl> </div> </body> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>