Show TOC

Using CSS Style Sheets in XML ViewsLocate this document in the navigation structure

Style sheets are included in XML views in the same way as plain HTML. To add further CSS classes to SAPUI5 controls, use the class attribute.


The effect is the same as calling myButton.addStyleClass(...).

Tip We recommend to carefully choose the elements that you style as the CSS always affects the whole page and is not restricted to the view.


To add a style sheet, add the style definition.
To add a style class and define a button that uses it, add the following coding:
<mvc:View controllerName="sap.hcm.Address" xmlns="sap.ui.commons" xmlns:mvc="sap.ui.core.mvc"
      .mySuperRedButton {
         color: red;
      <Button class="mySuperRedButton" text="Press Me"/>