我有一个脚本可以从 MySQL 表中生成数据行。如果文本(数据)长于可用空间,则文本会换行。这很好,但是当文本换行时,换行行上的边距将被忽略。
代码:
<div class="TabelText"><?php echo $row_Audits['SeqText'];?></div>
.TabelText {
font-family: Tahoma, Geneva, sans-serif;
font-size: 12px;
color: #950000;
margin-left: 10px;
}
Run Code Online (Sandbox Code Playgroud)
结果:
0401 Bathroom Door & Frame (Inside
and Outside)
Run Code Online (Sandbox Code Playgroud)
有没有办法产生如下结果:
0401 Bathroom Door & Frame (Inside
and Outside)
Run Code Online (Sandbox Code Playgroud)
非常感谢您抽出时间。
使用此显示:inline-block;
.TabelText {
font-family: Tahoma, Geneva, sans-serif;
font-size: 12px;
color: #950000;
margin-left: 10px;
display: inline-block
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2991 次 |
| 最近记录: |