html5怎么压缩图片

html-css015

html5怎么压缩图片,第1张

HTML是用来做网站的一种语言哈,就是在html里面改变图片的大小就要改变文件代码,打开图片源代码,图片文件的大小是height,和宽,我们可以更改,在语言中我们需要设置的都是英文的。

现在压缩工具将图片缩小之后都会对画质有影响,压缩图片文件选择压缩工具页面中的普通压缩就可以了压缩程度不要过大,找到图片压缩工具,图片要放置在工具页面上进行数据分析,根据图片的大小工具会制定压缩方案。

图片分享论坛却只允许发几百KB的文件;微信、分享给朋友的时候自动压缩的图像都比较模糊

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]

rotate是旋转不是缩放,缩放应该是scale属性吧

旋转参照点可以通过transform-origin来设置

语法为transform-origin: x-axis y-axis z-axis

建议查看 CSS3 transform属性