html - 具有响应性的垂直文本
问题描述
我正在为垂直文本而苦苦挣扎
这是我的笨蛋
我想做的是制作一个垂直文本,其中:
- 如果短文本出现在垂直文本的 div 内,那么它应该在 div 的中间
- 如果 div 内有长文本,它应该从页面底部开始,但它应该是响应式的(例如,如果我最小化我的窗口底部文本不应该隐藏它会在 div 中出现)并且
...
省略号应该在垂直文本中大文本的最后一个
我已经实现了 1。但是 2nd 没有完全工作,没有响应,文本进入 div 并且不可见。
解决方案
这可能会帮助你
.main{
transform: translate(0, 50%) rotate(-90deg);
}
.sub{
white-space: nowrap;
width: 250px;
height:20px;
overflow: hidden;
text-overflow: ellipsis;
text-align:center;
position: absolute;
cursor: pointer;
border: 1px solid grey;
background: linear-gradient(to right, white, lightgrey);
border-radius: 2px;
}
.two{
top:20px;
}
<div class="main">
<div class="sub one">Hello world!</div>
</div>
<div class="main">
<div class="sub two">a large text too large to contain tin the div. large text too large to contain tin the div.
</div>
</div>
推荐阅读
- android - Android:如何将所有子列表从 Firebase 获取到 arraylist
- javascript - 使用 javaScript 更改背景颜色(请不要使用 jQuery)?
- python - Glade:尝试删除列表存储行时的差异
- google-apis-explorer - 更新架构 Api 出错 - Google 云搜索
- dialogflow-es - DialogFlow - 从 webhook 设置 allRequiredParamsPresent?
- python - 如何将 Python 脚本中的字典列表导入 Ansible 剧本?
- python - 如何同时运行相同的 Python 脚本 X 次?
- html - 如何从 GitHub 存储库获取代码到另一个域?
- boto3 - 如何在 cloudSearch boto3 上使用具有多个值的 filterQuery
- apache - 如果端口号不同,如何将主机域定向到本地?