Siva Ganesh
Siva Ganesh

Reputation: 45

Using HTML5 CSS in Eclipse

I am beginner in SAPUI5. I am building SAPUI5 application with HTML5 in Eclipse. In index.html page I am creating a html5 page, I have created css folder under WebContent. In index.html I added to refer css file. But properties in css are not affecting in html page. Do I need to add any other code to refer CSS file.

Css:

@CHARSET "ISO-8859-1";
body {
background-image: "image/splash-sunrise.jpg";
background-size: 100px 100px; 
background-repeat:no-repeat; 
}

Upvotes: 1

Views: 3463

Answers (1)

Tim Gerlach
Tim Gerlach

Reputation: 3390

To use CSS within the SAPUI5 environment you should link your controls to a specific CSS class. You can do it like this:

var myButton = new sap.m.Button();
myButton.addStyleClass("myButtonStyle");

And your CSS could look like this:

@CHARSET "ISO-8859-1";

.myButtonStyle {
    color:#FFCCDD;
}

Make sure that you load the CSS file into your application, for example like this in your html file:

<link href="css/style.css" type="text/css" rel="stylesheet" />

Of course you can use this for your whole page as well. For your needs you could also take a look at the App control which provides some utilities for background images if you´re using mobile controls.

Upvotes: 1

Related Questions