Change the color of Datepicker

Asked

Viewed 908 times

0

I’m trying to modify the background color of my jquery datepicker , I searched the internet some solutions brought me this code:

.ui-datepicker {
color:white;
background-color: red;
 background: red; 
}

Only he doesn’t change the calendar, he stays the same :

His summoning code is as follows::

  <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<script>
$(function() {
    $("#calendario").datepicker({
        dateFormat: 'dd/mm/yy',
        dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
        dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
        dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
        monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
        monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez']
    });
});
</script>
<p>Data: <input type="text" id="calendario" /></p>

I can change the background color to make it legible?

1 answer

1


Enter the date element and enter the importance:

  $( function() {
    $( "#datepicker" ).datepicker();
  } );
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<input type="text" id="datepicker"></p>
<style>
.ui-datepicker-calendar{
background-color:red !important;
}
</style>

  • Thanks friend , it worked!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.