如何编写html5改变某一个区域的颜色和图片中的某一点相同?

html-css08

如何编写html5改变某一个区域的颜色和图片中的某一点相同?,第1张

您好!根据我对你描述的问题,我是这样理解的。

代码(html5中)背景颜色——>更换成图片上的某点的颜色。

我的回答是:把图片放入到图片编辑软件(例如:PS)中,单击 颜色块

     弹出一个拾色器。复制红色框框中的颜色值,粘贴到html5中即可。(例如:background:#c62013)

html5中设置整页背景图片的方法是利用css3样式:

写法如下:

img.bg {

 /* Set rules to fill background */

 min-height: 100%

 min-width: 1024px

 /* Set up proportionate scaling */

 width: 100%

 height: auto

 /* Set up positioning */

 position: fixed

 top: 0

 left: 0

}

@media screen and (max-width: 1024px) { /* Specific to this particular image */

 img.bg {

   left: 50%

   margin-left: -512px  /* 50% */

 }

}

效果如: