2-4作业提交

来源:2-4 编程练习

qq_慕斯7214945

2020-08-23 15:52:57

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

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

<title>Document</title>

<style type="text/css">

.border,.padding,.content{/*给最外层的div设置样式*/

width:300px;height:300px;

float:left;margin-left:50px;

}

a{

text-decoration:none;

font-size:30px;

}

.div1,.div2,.div3{/*放置背景图片的div样式*/

width:220px;height:200px;

border:10px solid rgba(0,255,0,0.3);

padding:50px;

background-image:url("http://climg.mukewang.com/582c316e0001fd6507000210.jpg");

margin-top:50px;

}

.border:hover div,.padding:hover div,.content:hover div{

display:block;

}

.div1{

background-clip: border-box;

}

.div2{

background-clip: padding-box;

}

.div3{

background-clip: content-box;

}

.div1,.div2,.div3{

display: none;

}

</style>

</head>

<body>

<div class="border">

<a href="">border-box</a>                  

<div class="div1"></div>            

</div>

<div class="padding">

<a href="">padding-box</a>

<div class="div2"></div>

</div>

<div class="content">

<a href="">content-box</a>            

<div class="div3"></div>

</div>

</body>

</html>


写回答

1回答

好帮手慕码

2020-08-23

同学你好,代码实现的是正确的。继续加油,祝学习愉快~

0

0 学习 · 40143 问题

查看课程

相似问题