Web
- <div class="greybox">
- <div class="redbox">
- Lorem ipsum dolor sit amet, consec etur
- </div>
- </div>
-
- .greybox {
- background-color: #e0e0e0; /* grey 300 */
- width: 320px;
- height: 240px;
- font: 900 24px Roboto;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .redbox {
- background-color: #ef5350; /* red 400 */
- padding: 16px;
- color: #ffffff;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
Dart
- var container = Container( // grey box
- child: Center(
- child: Container( // red box
- child: Text(
- "Lorem ipsum dolor sit amet, consec etur",
- style: bold24Roboto,
- overflow: TextOverflow.ellipsis,
- maxLines: 1,
- ),
- decoration: BoxDecoration(
- backgroundColor: Colors.red[400],
- ),
- padding: EdgeInsets.all(16.0),
- ),
- ),
- width: 320.0,
- height: 240.0,
- color: Colors.grey[300],
- );
Teaser 截图自 flutter.io 官网。 【编辑推荐】 - JetBrains 2018 中国开发者生态报告:Java 最流行
- 高效开发 Dubbo?用 Spring Boot 可得劲!
- 程序员的快速开发框架:Github上10大优秀的开源后台控制面板
- 【开发必看】你真的了解回流和重绘吗?
- 本月 Firefox 65 将加入 Flexbox Inspector 开发者工具
【责任编辑:未丽燕 TEL:(010)68476606】
点赞 0 (编辑:威海站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|