文字围绕浮动元素的妙用(HTML、CSS)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>文字围绕浮动元素的妙用</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 300px;
height: 50px;
background-color: skyblue;
margin: 0 auto;
padding: 5px;
}
.pic {
float: left;
width: 54px;
height: 49px;
margin-right: 5px;
}
.pic img {
width: 100%
}
</style>
</head>
<body>
<div class="box">
<div class="pic">
<img src="https://pic.imgdb.cn/item/611241215132923bf85e68bc.jpg" alt="">
</div>
<p>【集锦】热身赛-巴西0-1秘鲁 内马尔替补两人血染赛场</p>
</div>
</body>
</html>