#占位符和$占位符
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!
大多数开发人员都不知道每个属性,甚至更少的开发人员意识到它们是如此完美!
#占位符和$占位符