网页 综合 更新时间 2026-11-14 16:23:38

ion-button: Style Buttons with Custom CSS Properties

自动蜘蛛 ionicframework.com 正文约 1928 字
Buttons provide a clickable element, which can be used in forms, or anywhere that needs simple, standard button functionality. They may display text, icons, or both. Buttons can be styled with several attributes to look a specific way.
This property lets you specify how wide the button should be. By default, buttons have display: inline-block, but setting this property will change the button to a full-width element with display: block.
This property lets you specify the shape of the button. By default, buttons are rectangular with a small border radius, but setting this to "round" will change the button to a rounded element.
This property determines the background and border color of the button. By default, buttons have a solid background unless the button is inside of a toolbar, in which case it has a transparent background.
This property specifies the size of the button. Setting this property will change the height and padding of a button.
Buttons are built to be accessible, but may need some adjustments depending on their content. The button component renders a native button element which allows it to take advantage of the functionality that a native button provides.
There are many cases where a button's text content may overflow the container. It is recommended to wrap the text inside of the button when this happens so that all of the text can still be read. The button component will automatically adjust its height to accommodate the extra lines of text.
The button text does not automatically wrap to the next line when the text is too long to fit. In order to make the text wrap, the ion-text-wrap class can be added, which will set the white-space property to "normal". This will become the default in a future major release.
The max-width style is set on the button below for demo purposes only. Text wrapping will work with a dynamic button width.
No public methods available for this component.
访问原文 返回搜索 https://ionicframework.com/docs/api/button
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。