让ä¸ä¸ªå¾çå¨divä»»æä½ç½®ï¼å¯ä»¥ä½¿ç¨ç»å¯¹å®ä½çæ¹å¼ãå¦ä¸ç¤ºä¾ä»£ç ï¼
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>æµè¯é¡µé¢</title>
</head>
<body>
<style type="text/css">
.test-box{width:300px;height:260px;margin:0px auto;position:relative;border:1px solid #333;}
.test-box img{position:absolute;bottom:10px;left:50%;margin-left:-60px;border:0;}
</style>
<div class="test-box">
<img src="https://www.baidu.com/img/baidu_jgylogo3.gif?v=31680756.gif">
</div>
</body>
</html>
示ä¾ä¸åäºä¸ä¸ªå®½ä¸º300pxï¼é«ä¸º260pxåç´ ç容å¨ï¼å
¶ä¸å¾çéè¿ç»å¯¹å®ä½ï¼æ§å¶å
¶ä½äºå®¹å¨çæ°´å¹³å±
ä¸ï¼å®¹å¨åºé¨çä½ç½®ãbottom:10px;æ§å¶å¾çè·ç¦»åºé¨10pxï¼left:50%ãmargin-left:-60px;æ§å¶å¾çæ°´å¹³å±
ä¸ãå
¶ä¸çmargin-leftçå¼æ ¹æ®å¾ç宽度ååï¼ä¸ºè´çäºåä¹ä¸å¾ç宽度ã
æç»ææå¦ä¸å¾ï¼
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/00e93901213fb80e20b64a7833d12f2eb938943d?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)