博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css3 背景
阅读量:7240 次
发布时间:2019-06-29

本文共 2223 字,大约阅读时间需要 7 分钟。

代码块

html页面:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>css3 背景</title>

</head>

<body>

<div class="container bgclip-border">CSS3 background-clip属性-border-box</div>

<div class="container bgclip-padding">CSS3 background-clip属性-padding-box</div>

<div class="container bgclip-content">CSS3 background-clip属性-content-box</div>

<div class="container bgorigin-border">CSS3的background-Origin属性-border-box</div>

<div class="container bgorigin-padding">CSS3的background-Origin属性-padding-box</div>

<div class="container bgorigin-content">CSS3的background-Origin属性-content-box</div>

<div class="container imgSize2">伸展背景图像完全填充内容区域</div>

<div class="container imgSize">CSS3 background-size属性</div>

<div class="container imgContainer2">可以给不同的图片设置多个不同的属性</div>

<div class="container imgContainer">CSS3 background-image属性</div>

</body>

</html>

css样式:

<style type="text/css" media="screen">

.container{

width: 800px;

height: 600px;

padding: 20px;

margin:50px;

}

.imgContainer{

background-image: url(pulpitrock.png),url(dd.png);

background-position: right bottom,left top;

background-repeat: no-repeat,repeat;

}

.imgContainer2{

background: url(bb.png) right bottom no-repeat,url(aa.png) left top repeat;

}

.imgSize{

background:url(jigsaw.jpg);

background-size: 80px 60px;

background-repeat: no-repeat;

}

.imgSize2{

background: url(bg.png);

background-size: 100% 100%;

background-repeat: no-repeat;

}

.bgorigin-content{

background: url(content.png);

background-repeat: no-repeat;

background-size: 100% 100%;

background-origin: content-box;

}

.bgorigin-padding{

background:url(padding.png);

background-repeat: no-repeat;

background-size: 100% 100%;

background-origin: padding-box;

}

.bgorigin-border{

background: url(border.png);

background-repeat: no-repeat;

background-size: 100% 100%;

background-origin: border-box;

}

.bgclip-content{

border:10px dotted black;

background: #008000;

background-clip: content-box;

}

.bgclip-padding{

border:10px dotted black;

background: #008000;

background-clip: padding-box;

}

.bgclip-border{

border:10px dotted black;

background: #008000;

background-clip: border-box;

}

</style>

本文转自  素颜猪  51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1883419

转载地址:http://oxfbm.baihongyu.com/

你可能感兴趣的文章
获取jar包路径,遍历
查看>>
solidity智能合约[40]-memory属性
查看>>
【VMware vSAN 6.6】5.1.基于存储策略的管理:vSAN硬件服务器解决方案
查看>>
javascript基础修炼(10)——VirtualDOM和基本DFS
查看>>
ISTP论文发表 SCI论文发表 EI论文发表常识
查看>>
怎样轻松几步将视频转换成GIF
查看>>
离线批量数据通道Tunnel的最佳实践及常见问题
查看>>
ECS应用管理最佳实践
查看>>
12.throw和throws是的区别
查看>>
115.springboot + mybaties
查看>>
福建海峡银行使用ManageEngine统一管控业务应用系统
查看>>
ssh访问与控制
查看>>
java访问数据库
查看>>
皆大欢喜!iPhone不再耗电,续航增加就靠它
查看>>
路由重发布配置代码
查看>>
编写脚本 sumid.sh,计算/etc/passwd文件中的第10个用户和第20用户的 ID之和
查看>>
MYSQL数据库命令
查看>>
C语言win32窗口的俄罗斯方块程序
查看>>
【翻译】Ext JS 5的平板支持
查看>>
工作之餘的保健之法
查看>>