Home > Web Front-end > HTML Tutorial > css image mosaic_html/css_WEB-ITnose

css image mosaic_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:10:55
Original
1400 people have browsed it

How to embed a small photo in the middle of a big photo


Reply to discussion (solution)

<!DOCTYPE HTML><html>	<head>		<meta charset="gb2312" />		<title></title>		<style>			div {				width:120px; height:120px;				background:url(http://avatar.profile.csdn.net/3/1/9/2_a138762698828.jpg) no-repeat;				text-align:center;			}			img {				margin-top:30px;			}		</style>	</head>	<body>		<div>			<img src="http://avatar.profile.csdn.net/3/1/9/2_a138762698828.jpg" width="60" />		</div>	</body></html>
Copy after login




What does the original poster mean?

That’s probably what it means, but how to adjust the position of the small photo?

The small photo is now centered

margin-top:30px; Adjust the top margin based on this

Add position:relative IMG to the outer div and try using the top left CSS attribute

500-member Advanced QQ Group:
HTML/CSS Technology Zone (202023795) Verify CSDN

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template