cancel
Showing results for 
Search instead for 
Did you mean: 

Two button classes

Former Member
0 Kudos

I want two buttons to have different colours. I’d appreciate assistance.

I’m successfully changing the colour of both buttons to be the same with the following CSS in the Custom CSS file:


.sapMBtnInner {

    background: brown !important;

color: white !important;

}

To enable the two buttons to have different colours,  I thought the solution would be to create the following two classes (one for each colour ) in the Custom CSS file and refer to the relevant class in the button’s CSS Class.


.MyButtonSelected.sapMBtnInner {

    background: brown !important;

color: white !important;

}



.MyButtonUnSelected.sapMBtnInner {

    background: white !important;

color: black !important;

}

But neither the MyButtonSelected nor MyButtonUnSelected is being recognised. Any suggestions as to what I need to do?

Thanks in advance.

Greg

Accepted Solutions (1)

Accepted Solutions (1)

former_member227918
Active Contributor
0 Kudos

Hi Greg,

keep space between both classes, try below:

use

.MyButtonSelected .sapMBtnInner{


not

.MyButtonSelected.sapMBtnInner {




-Akhilesh

Former Member
0 Kudos

The spaces did the trick.

Thanks Akhilesh

Answers (1)

Answers (1)

former_member206841
Participant
0 Kudos

Hello Greg,

Below is the code similar to your code and things work.

.mybutton { 

    background: brown !important; 

color: black !important; 

.mybutton2 { 

    background: white !important; 

color: black !important; 

}

Configure mybutton as cssclass to button 1 and mybutton2 tas cssclass o button2.

Is this what you are trying to achieve or something different?

Regards

Dinesh