html - 文本换行,css
问题描述
文本换行问题。元素“.usser a”不换行,或者如果我在“.usser”中使用溢出,则此元素与 div 重叠,我看不到按钮。
.usser button {
background-color: transparent;
width: 20px;
height: 20px;
}
.usser {
margin-left: 5px;
margin-bottom: 5px;
height: 25px;
border-bottom: 1px solid red;
margin-top: 25px;
}
.usser a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.usser div {
float: right;
}
<div class="employee" id="employee">
<div id="list">
<p id="1" class="usser">
<a>xxx</a>
<div>
<button></button>
<button></button>
</div>
</p>
解决方案
只需使用 div 标签而不是 p 段落。
.usser button {
background-color: transparent;
width: 20px;
height: 20px;
}
.usser {
margin-left: 5px;
margin-bottom: 5px;
height: 25px;
border-bottom: 1px solid red;
margin-top: 25px;
}
.usser a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.usser div {
float: right;
}
<div class="employee" id="employee">
<div id="list">
<div id="1" class="usser">
<a>xxx</a>
<div>
<button></button>
<button></button>
</div>
</div>
推荐阅读
- angular - 提高 Keycloak 初始化性能
- jdbc - Jmeter JDBC请求采样器不进行更新
- xml - ICS-10064:准备映射器对象时出错:“元素”中的元素“复杂类型”无效
- r - 从其他 R 脚本中运行 R markdown (.Rmd) 以生成 HTML
- html - 如何在我的代码中为几行加载自定义 CSS?
- python - 使用 Heroku 上托管的 Selenium 登录 Instagram 时无法找到元素“用户名”
- pyspark - 改进 PySpark 实现以在图中查找连接的组件
- go - 为什么 go module ssh custom private repo (non-github) config 仍然请求 https fetch?
- database - 通过 Typoscript 查询从 Typo3 数据库中选择 url
- jquery - 从 ajax 响应更改 img 类名