css过渡属性不在悬停时工作

时间:2018-02-04 10:52:56

标签: html css3 css-transitions

当我悬停块时,我正在尝试应用css过渡属性。但它不起作用。这是代码



<div class="dropdown">
  <button class="dropbtn" id="service">
          Services
        </button>
  <div class="dropdown-content">
    <a href="#">Service1</a>
    <a href="#">Service2</a>

  </div>
</div>
&#13;
  DELIMITER $$
DROP PROCEDURE IF EXISTS spFoo $$
CREATE PROCEDURE spFoo ()
BEGIN
    Declare v_start datetime;
    declare v_end datetime;

    Set v_start = '01/dec/2017';
    set v_end = '31/jan/2018';

    -- --SQL Declarations to inject
    declare table_name nvarchar(150);
    -- -----Change the table you want to use (logins or questions)
    set table_name =  Concat('', QUOTENAME('logins') ,'');

END $$

    DELIMITER ;
&#13;
&#13;
&#13;

是因为我添加了下拉菜单还是我错过了什么?我是这个领域的新手。非常感谢。

1 个答案:

答案 0 :(得分:0)

这不能在您的代码中显示

您可以翻译不透明度宽度高度,背景颜色,......

&#13;
&#13;
.dropdown {
  position: absolute;
  display: inline-block;
  z-index: 1;
  top: 25px;
}

.dropbtn {
  background-color: #4CAF50;
  color: white;
  padding: 15px;
  font-size: 20px;
  border-radius: 0 5px 5px 0;
  border: none;
}

.dropdown-content {
  display: inline-grid;
  background-color: #4CAF50;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 0 5px 5px 0;
  Opacity:0;
}

.dropdown:hover {
  left: 20px;
}

.dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: inline-block;
}

.dropdown:hover .dropdown-content {
   transition:all 1s ease;
  Opacity:1;
}
&#13;
<div class="dropdown">
  <button class="dropbtn" id="service">
          Services
        </button>
  <div class="dropdown-content">
    <a href="#">Service1</a>
    <a href="#">Service2</a>

  </div>
</div>
&#13;
&#13;
&#13;

jsfiddle

More information