导航
×
   ❮   
HTML CSS JavaScript PHP Go Sass W3C Colors ECMS

CSS ::file-selector-button 伪元素


实例

为<input type="file"> 按钮设置样式

::file-selector-button {
  border: 2px solid black;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: lightgreen;
}
亲自试一试 »

更多“自己尝试”的例子见下文。


定义和用法

::file-selector-button 伪元素选中任何类型为<input type="file"> 的按钮。

版本 CSS 伪元素模块第 4 级

浏览器支持

表中数字表示首次完全支持此伪元素的浏览器版本。

伪元素
::file-selector-button 89  89 82 14.1 75

CSS 语法

::file-selector-button {
  CSS 声明;
}

更多实例

实例

为<input type="file"> 按钮设置样式,并添加悬停效果

::file-selector-button {
  border: 2px solid black;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: lightgreen;
}

::file-selector-button:hover {
  background-color: salmon;
  cursor: pointer;
}
亲自试一试 »

相关页面

CSS 教程:CSS 伪元素


Copyright ©2020-2026 freew3c.com All Rights Reserved 提供的内容仅用于学习和测试,不保证内容的正确性。