请问可以这样实现么

来源:2-15 编程练习

夜魇丶

2019-06-01 18:55:18

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>background属性</title>

    <style type="text/css">

        /*此处写代码*/

        div{

            width:600px;

            height:300px;

            border:3px solid rgba(255,0,0,0.5);

            padding: 20px;

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

            background-repeat: no-repeat;

            background-size: 90%;

            background-clip: padding-box;

            background-position: center;

            text-align: center;

        }

        span{

            font-size: 24px;

            font-weight: bold;

        }

    </style>

</head>

<body>

    <!-- 此处写代码 -->

    <div>

        <span>慕课网(IMOOC)国内最大的IT技能学习平台</span>

    </div>

</body>

</html>


写回答

1回答

好帮手慕星星

2019-06-01

你好,还需要添加一个背景颜色哦:

http://img.mukewang.com/climg/5cf25e0900012b7611000397.jpg

设置上就没有问题了。

祝学习愉快!

0

0 学习 · 40143 问题

查看课程