惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
Cloudbric
Cloudbric
The Register - Security
The Register - Security
小众软件
小众软件
PCI Perspectives
PCI Perspectives
G
Google Developers Blog
AI
AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
TaoSecurity Blog
TaoSecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
N
Netflix TechBlog - Medium
博客园_首页
Last Week in AI
Last Week in AI
A
Arctic Wolf
B
Blog RSS Feed
J
Java Code Geeks
C
Cybersecurity and Infrastructure Security Agency CISA
I
InfoQ
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
NISL@THU
NISL@THU
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Jina AI
Jina AI
有赞技术团队
有赞技术团队
S
Schneier on Security
L
Lohrmann on Cybersecurity
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
Vercel News
Vercel News
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Hacker News: Ask HN
Hacker News: Ask HN
A
About on SuperTechFans

博客园 - 我就是那个王小明

git修改历史提交记录名字 gitbase配置两个git仓库源头地址 yarn dev 或者 npm run dev 或node -v 等报错:'node' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 htmlToPdf ES6 Generator使用 - 我就是那个王小明 - 博客园 数组中的每一项按照某个属性分组 - 我就是那个王小明 - 博客园 前端开发快速定位bug的一些小技巧 基本css拼图形 forEach时候删除数组某一属性项,使用splice容易出现问题 对于vue的一些理解 配置vuex并使用 vue搭建开发环境 小程序开发中遇到的问题 rem原理 vue使用webpack压缩后体积过大要怎么优化 分别使用ES5和ES6进行数组去重以及注意事项 nodeJS理解 package.json和bower的参数解释 Angular.js基础
一些意想不到的小bug。
我就是那个王小明 · 2018-07-05 · via 博客园 - 我就是那个王小明

一,当if的时候,很容易忘记相对的else,从而出现bug,要将背面消息考虑全面。
二,多个元素在同一行布局的时候,要考虑文字的换行还是省略号代替。

例如:左边一个文字,宽度不固定,右边一个图形,宽度固定。左边文字多的时候,在小屏手机上不换行,用省略号代替,然而在大屏手机上还可以显示比小屏手机多一些字数,这样保证所有元素对齐并且保持在一行。
结构:

<div class="container">
    <div class="left-text">
        <span>此处的文字字数不固定</span>
    </div>
    <div class="right-graf">
        <i></i>
    </div>
</div>
style: 
.container: {
    display: flex;
    flex-item: center;
}
.right-graf: {
    width: 120px;//固定宽度
    i {
        箭头样式;省略。。。。
    }
}
.left-text: {//此样式可以保证在小屏手机上不换行,用省略号代替多余的文字,在大屏手机上可以显示更多文字。
    max-width: 160px;//此宽度为在小屏手机例如ipone5上在右边宽度固定的情况下,能够使文字不换行的最大宽度
    white-space: nowrap;//不换行
    overflow: hidden;
    text-overflow: ellipsis;//省略号代替
}