I need only background-color:red; to appear and disappear smoothly background-color:red; , and not a whole block, as in my example.
$("#button_1").click(function() { $("#div3").fadeIn(2000); }); $("#button_2").click(function() { $("#div3").fadeOut(2000); }); #div3 { width: 100px; height: 100px; display: none; background-color: red; font-weight: bold; text-align: center; } .but { text-align: center; font-weight: bold; border: 1px solid #00748f; height: 25px; width: 100px; background-color: #0483a0; cursor: pointer; color: #FFF; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <div class="but" id="button_1">Показать</div> <br> <div class="but" id="button_2">Скрыть</div> <br> <div id="div3">Текст</div>