#占位符和$占位符_占位符和溢出

#占位符和$占位符

Oftentimes our search boxes and other form fields get drastically shortened on mobile devices.  Unfortunately in some circumstances the INPUT element's placeholder text doesn't fit within the length of the element, thus displaying an ugly "cut off."  To prevent this ugly display, you can use CSS placeholder styling and text-overflow: ellipsis!

通常,我们的搜索框和其他表单字段在移动设备上会大大缩短。 不幸的是,在某些情况下,INPUT元素的占位符文本不适合该元素的长度,因此显示难看的“截断”。 为了避免这种丑陋的显示,可以使用CSS占位符样式text-overflow: ellipsis


input[placeholder] { text-overflow: ellipsis; }
::-moz-placeholder { text-overflow: ellipsis; } /* firefox 19+ */
input:-moz-placeholder { text-overflow: ellipsis; }


Most developers are unaware of each of the properties and even fewer are aware that they are so perfectly complimentary!

大多数开发人员都不知道每个属性,甚至更少的开发人员意识到它们是如此完美!

翻译自: https://davidwalsh.name/placeholder-overflow

#占位符和$占位符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值