Div 用图片作为背景

心已入冬 提交于 2020-01-27 05:38:11
<!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">
    <!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>

<body>
    <!-- 1,Div背景图片 -->
    <div></div>




</body>

</html>
* {
    margin: 0;
    padding: 0;
}

/*p {
    width: 300px;
    height: 40px;
    line-height: 20px;
    border: 1px solid black; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}*/

div{
	width: 200px;
	height: 200px;
	border: 1px solid black; 
	background-image: url(fb.jpeg);
	background-size: 100px 100px;
	background-repeat: no-repeat;
	/*background-position: center center;*/
	background-position: 50% 50%;
}

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!