CSS按钮:active not working

标签 css

也许这只是一个我忽略的愚蠢问题。

Fiddle

表格上方的按钮和删除按钮都遵守 :active 子句中的 box-shadow,但第 5 个单元格不遵守。

我使用的是 Chrome 23。

最佳答案

您希望按钮位于第 5 个 td 中吗?如果是,则删除此内容

Demo

#table button{    
    position: absolute;
    top: 0px;
    right: 5px;
    height: 10px;
    width: 1.5em
}

或者,如果您希望按钮位于此处(表格外),请将 #table button 替换为以下样式

Demo 2

#table button{    
    position: absolute;
    top: 0px;
    right: 5px;
}

还要添加这个

#table button:active{    
    position: absolute;
    top: 0px;
    right: 5px;
    top: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
    background-image: none
}

Note: You are using position: absolute;, be sure you've wrapped it inside a position: relative; container

关于CSS按钮:active not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13795954/

相关文章:

html - 谷歌字体不会加载 html

JavaScript, AngularJS : How do I know if element is larger than its container?

jquery - 无法对齐插入按钮

javascript - 如何从网页中打开一个小方框进行选择

javascript - 为什么 CSS transform-origin 和 transform 不能一起过渡?

css - Ionic fab 按钮动画问题

css - 如何通过其部分类名 CSS 获取元素

html - CSS 幻灯片在 Firefox 中不再有效;在所有其他浏览器中闪烁

html - 右边框渐变

css - 宽度:100% 无滚动条