HTML循环缩放代码(css缩放代码)
admin 发布:2022-12-19 17:53 129
今天给各位分享HTML循环缩放代码的知识,其中也会对css缩放代码进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、html插入flash后,如何调整缩放比。
- 2、求能自动缩放网页大小的代码
- 3、如何实现HTML整体进行缩放 用css或javascript代码都可以
- 4、html图片在固定大小内自动缩小居中代码
- 5、html图片如何按屏幕大小等比例缩放?
html插入flash后,如何调整缩放比。
在flash里加代码:fscommand("fullscreen", "true");
并设置宽高为100%:embed menu="true" type="application/x-shockwave-flash" loop="true" play="true" src="4.swf" width="100%" height="100%" pluginspage=""
还可以再加下面属性:
param name="allowFullScreen" value="true" /
求能自动缩放网页大小的代码
取屏幕大小
screen.width
screen.height
根据屏幕大小缩放
if (window.screen.width=='600')
document.write ('body style="zoom: 55%"');
else if (window.screen.width=='800')
document.write ('body style="zoom: 75%"');
如何实现HTML整体进行缩放 用css或javascript代码都可以
你可以使用CSS zoom属性
例如:
body {
zoom: 3;
-moz-transform: scale(3);
-moz-transform-origin: 0 0;
}
把整个body放大三倍,缩小同理,改成比1小的数字即可
html图片在固定大小内自动缩小居中代码
script language="JavaScript"
!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD){
var image=new Image();
var iwidth = 180; //定义允许图片宽度
var iheight = 180; //定义允许图片高度
image.src=ImgD.src;
if(image.width0 image.height0){
flag=true;
if(image.width/image.height= iwidth/iheight){
if(image.widthiwidth){
ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.heightiheight){
ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
}
}
//--
/script
!--图片--
div style="border:1px #000000 solid; width:180px;height:180px;text-align:center;"
img src=".." onload = "DrawImage(this)"
/div
html图片如何按屏幕大小等比例缩放?
html图片按屏幕大小等比例缩放若浏览器允许可按Ctrl+鼠标滚轮滑动缩放,或用代码。
具体方法如下:
Ctrl+鼠标滚轮滑动缩放
css代码与htlm代码
CSS 代码如下:
#background
{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #211f1f;
display:none\8;
}
#background .bg-photo
{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: none;
overflow: hidden;
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important;
background-size: cover !important;
}
#background .bg-photo-1
{
background: url('../image/alone.jpg') no-repeat center center;
}
#background-ie {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #211f1f;
}
HTML代码如下:
div id="background"
div class="bg-photo bg-photo-1" style="display: block;"/div
/div
参考资料
html 网页背景图片根据屏幕大小CSS自动缩放.CSDN博客[引用时间2017-12-29]
关于HTML循环缩放代码和css缩放代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 03-28html网页布局模板(html网页布局模板代码)
- 03-28html简单网页代码成品(用html制作网站代码)
- 03-28web前端网页设计代码(web前端网页设计代码作业)
- 03-07seo页面(seo页面代码优化)
- 03-07网页代码模板(网页代码模板在哪找)
- 03-06网页搜索引擎(网页搜索引擎代码)
- 03-06网页设计图片(网页设计图片滚动代码怎么弄)
- 03-06制作网页的代码(制作网页的代码是什么语言)
- 03-06简单网页设计(简单网页设计代码)
- 03-06html空白模板(html中空白代码)
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接