CSS 图片与文字垂直居中对齐,文字超出需换行,并从图片底部开始排列

效果图:

在这里插入图片描述

html:
<div class="title-box">
		<div class="title-content">
				<span class="title-tag">
						123
				</span>
				<img class="icon" src="/static/images/work/repairicon.png" >
				1. 测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试
		</div>
</div>
css:
.title-box {
		padding-bottom: 14px;
		border-bottom: 0.5px solid #f1f4fa;
		font-size: 16px;
		color: #333333;
		font-weight: 550;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.title-content {
			max-width: 315px;
			.title-tag {
				font-size: 12px;
				border-radius: 2px;
				padding: 3px 4px;
				text-align: center;
				height: 20px;
				line-height: 20px;
				margin-right: 5px;
				letter-spacing: 1px;
				font-weight: 400;
				background: #eeeeee;
				color: #999999;
				}
				.icon {
					width: 20px;
					height: 20px;
					margin-right: 5px;
					vertical-align: text-bottom;
				}
			}
		}

相关推荐

  1. ppt图片居中对齐

    2024-07-17 13:52:02       24 阅读
  2. CSS水平垂直居中

    2024-07-17 13:52:02       53 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-17 13:52:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-17 13:52:02       71 阅读
  3. 在Django里面运行非项目文件

    2024-07-17 13:52:02       58 阅读
  4. Python语言-面向对象

    2024-07-17 13:52:02       69 阅读

热门阅读

  1. Arrays的用法(附10道练习题)

    2024-07-17 13:52:02       24 阅读
  2. Hadoop之/etc目录下各配置文件的作用详解

    2024-07-17 13:52:02       18 阅读
  3. 前端学习常用技术栈

    2024-07-17 13:52:02       23 阅读
  4. Perl语言入门学习

    2024-07-17 13:52:02       21 阅读
  5. 【闲聊】-Perl的基础语法

    2024-07-17 13:52:02       24 阅读
  6. LVS的NAT方式

    2024-07-17 13:52:02       18 阅读
  7. SAP中MIR4使用的BAPI是什么,如何使用?

    2024-07-17 13:52:02       21 阅读
  8. cuda--docker

    2024-07-17 13:52:02       25 阅读
  9. WHAT - 介绍一个不太一样的 UI 组件库 shadcn/ui

    2024-07-17 13:52:02       19 阅读
  10. 从零开始!Jupyter Notebook的安装教程

    2024-07-17 13:52:02       22 阅读
  11. 数仓工具—Hive语法之替换函数和示例

    2024-07-17 13:52:02       19 阅读