CSS背景图拉伸不变形_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 11:39:40
原创
3284人浏览过

在线效果体验:http://hovertree.com/texiao/mobile/3.htm

请使用手机浏览器查看。

css代码:

.bg{  background:url(http://hovertree.com/texiao/mobile/3/hovertree01.jpg);  filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";  -moz-background-size:100% 100%;      background-size:100% 100%;  }  
登录后复制

 

HTML文件代码:

Cutout.Pro抠图
Cutout.Pro抠图

AI批量抠图去背景

Cutout.Pro抠图 18
查看详情 Cutout.Pro抠图

立即学习前端免费学习笔记(深入)”;

<!DOCTYPE html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>DIV缩放背景自适应(不变形)jQuery-HoverTree</title><style type="text/css">a {color: white;}body {font-family: 幼圆,宋体,'Times New Roman', Times, serif;color:white;}.picwidth {width: 100%;text-align: left;filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";-moz-background-size: 100% 100%;background-size: 100% 100%;}body {margin: 0px;background-color: #120c0c;}.content {width: 206px;margin: 0px auto;padding-top: 10px;line-height: 16px;}.frame {width: 256px;margin: 0px auto;}</style><script src="http://hovertree.com/ziyuan/jquery/jquery-2.1.4.min.js"></script></head><body><div class="frame"><div id="contentHead" style="height:231px;background-image:url(http://hovertree.com/texiao/mobile/3/hovertree01.jpg)" class="picwidth"><input type="button" value="放大" id="keleyibig" /><input type="button" value="缩小" id="keleyismall" /><a href="http://hovertree.com/hvtart/bjae/f43r3qry.htm">原文</a></div><div id="contentBody" style="background-image:url(http://hovertree.com/texiao/mobile/3/hovertree02.jpg);height:99px;color:White;" class="picwidth"><div class="content">今日人物:<div style="text-align:center">谢霆锋</div><br />请点击放大,缩小按钮。</div></div><div id="contentBottom" style="background-image:url(http://hovertree.com/texiao/mobile/3/hovertree03.jpg);height:124px" class="picwidth">DIV缩放背景自适应(不变形)<br />请使用支持HTML5的浏览器查看本页<br /><a href="http://hovertree.com/texiao/">特效库</a> <a href="http://hovertree.com">首页</a> <a href="http://keleyi.com">柯乐义</a> <a href="http://hovertree.com/hvtart/bjae/f43r3qry.htm">原文</a></div></div><script>$(function () {$(".frame").width(300);var documentWidth = $(document.body).width();if (documentWidth < 600)$(".frame").width(documentWidth);var cHead = $("#contentHead"); var cBody = $("#contentBody"); var cBottom = $("#contentBottom");function setHeight() {cHead.height(((cHead.width() / 320) * 289));cBody.height(((cBody.width() / 80) * 31));cBottom.height(((cBottom.width() / 64) * 31));}setHeight();$("#keleyibig").on("click", function (){$(".frame").width($(".frame").width() + 50)setHeight();})$("#keleyismall").on("click", function () {$(".frame").width($(".frame").width() - 50)setHeight();})})</script> </body></html>
登录后复制

Web前端资源:

这张图可作为手机屏幕背景

HTML速学教程(入门课程)
HTML速学教程(入门课程)

HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号