網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
?
?以上效果在實(shí)現(xiàn)時(shí),同事采用了js計(jì)算寬度的方式,單獨(dú)計(jì)算出【】區(qū)間的內(nèi)容寬度和占位寬度,但是因?yàn)楸旧硎褂昧撕芏鄇s的計(jì)算,以及長(zhǎng)列表v-for循環(huán),這顯然會(huì)影響到頁(yè)面性能,因此,我在布局上做了略微的調(diào)整,改用純css的方式,雖然只是一點(diǎn)點(diǎn)性能上的優(yōu)化,但正是這一點(diǎn)點(diǎn)差異的積攢,才能使得項(xiàng)目運(yùn)行更加的流暢。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.text-box {
display: flex;
width: 400px;
}
.title {
flex-shrink: 0;
}
.right-div {
padding: 0 20px;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
-moz-text-overflow: ellipsis;
white-space: nowrap;
}
.left {
position: absolute;
left: 0;
width: 20px;
}
.right {
position: absolute;
right: 0;
width: 20px;
}
</style>
</head>
<body>
<div class="text-box">
<div class="title">合同復(fù)用-測(cè)試</div>
<div class="right-div">
<span class="left">【</span>
<span>合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用合同復(fù)用</span>
<span class="right">】</span>
</div>
</div>
</body>
</html>
原文鏈接:https://blog.csdn.net/m0_47135993/article/details/121743571
相關(guān)推薦
- 2022-08-10 Qt利用DOM類實(shí)現(xiàn)讀取xml文件_C 語(yǔ)言
- 2022-03-20 .NET?6開發(fā)TodoList應(yīng)用之實(shí)現(xiàn)接口請(qǐng)求驗(yàn)證_實(shí)用技巧
- 2022-10-19 Android?webview加載H5方法詳細(xì)介紹_Android
- 2023-02-09 go?sync?Once實(shí)現(xiàn)原理示例解析_Golang
- 2023-02-27 python定時(shí)任務(wù)sched庫(kù)用法簡(jiǎn)單實(shí)例_python
- 2022-07-06 pyinstaller?pathex參數(shù)引發(fā)打包no?module?name異常_python
- 2022-12-27 一文帶你了解Go語(yǔ)言標(biāo)準(zhǔn)庫(kù)strings的常用函數(shù)和方法_Golang
- 2022-07-29 Linux文件系統(tǒng)介紹_linux shell
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支