Div 用图片作为背景





    
    
    
    
    
    Document



    
    
* {
    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%;
}

 

你可能感兴趣的:(Html&CSS)