简体   繁体   中英

changing button style not working

I am using the full calendar. I want to change the default, hover or active state for buttons on the header.

All I want it to make :

default: black background, white text color  
hover :  red background color,  white text color  
active:  green background color,  white text color

The CSS code:

.fc-state-default {
  color: white;
  background-color: black;
}

.fc-state-active {
  background-color: green;
}

.fc-state-hover {
  background-color: red;
  color: white;
  border-color: black;
  border-width: medium;
}

For some reasons that I can't understand I can't change the style of those buttons.

Here is a js fiddle. JSFIDDLE

Please, can somebody help me!

EDIT if I have something like this:

<div class="fc-right">
<div class="fc-button-group">
<button type="button" class="fc-month-button fc-button fc-state-default fc-corner-left fc-state-active">month</button>
<button type="button" class="fc-agendaWeek-button fc-button fc-state-default">week</button>
<button type="button" class="fc-agendaDay-button fc-button fc-state-default">day</button>
<button type="button" class="fc-today-button fc-button fc-state-default fc-corner-right fc-state-disabled" disabled="disabled">today</button>
</div>
</div>

It is quite simple, just add these css classes:

.fc-button .fc-button-inner:hover {
    background-color: red;
    color: #fff;
}

.fc-button.fc-state-active .fc-button-inner {
    background-color: green;
    color: #fff;
}

.fc-button .fc-button-inner {
    background-color: #000;
    color: #fff;
}

Here is the fiddle: fiddle link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM