Skip to content

Built-in style - Vant 4

Built-in Style ​

Intro ​

Vant contains some common styles that can be used directly by the className.

Text ellipsis ​

When the text content length exceeds the maximum container width, the excess text is automatically omitted.

html
This is a paragraph that displays up to one line of text, and the rest of the text will be omitted.  This is a paragraph that displays up to two lines of text, and the rest of the text will be omitted.  This is a paragraph that displays up to three lines of text, and the rest of the text will be omitted.

Hairline ​

Add 1px border under the Retina screen for the element, based on a pseudo element.

html

Safe Area ​

Enable safe area.

html

Animation ​

html

Haptics Feedback ​

Add haptics feedback for an element. When touched, the opacity of the element is reduced.

Usually used in clickable elements such as button.

html

Clearfix ​

Clear floated content within a container.

html

Enterprise-level mobile solution based on Vant