栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

采用 作为CSS背景

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

采用  作为CSS背景

这在WebKit中已经成。

<html> <head> <style> div { background: -webkit-canvas(squares); width:600px; height:600px; border:2px solid black } </style> <script type="application/x-javascript">function draw(w, h) { var ctx = document.getCSSCanvasContext("2d", "squares", w, h); ctx.fillStyle = "rgb(200,0,0)"; ctx.fillRect (10, 10, 55, 50); ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; ctx.fillRect (30, 30, 55, 50);} </script> </head> <body onload="draw(300, 300)">   <div></div> </body></html>

当前,Firefox 4包含一项功能,该功能允许您以这种方式将任何元素(包括画布)用作CSS背景:

<p id="myBackground1" >  This element will be used as a background.</p><p >  This box uses #myBackground1 as its background!</p>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/514694.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号