当前位置: 首页 > 软件库 > Web应用开发 > CSS框架 >

select-css

授权协议 MIT License
开发语言 HTML/CSS
所属分类 Web应用开发、 CSS框架
软件类型 开源软件
地区 不详
投 递 者 雷飞虎
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

select-css

Cross-browser select element CSS for consistent select element styling.

Article: https://www.filamentgroup.com/lab/select-css.html


Demo page: http://filamentgroup.github.io/select-css/demo/

Download: select-css.css

Available on npm: npm install fg-select-css


Usage

Include the following file:

Its CSS will style any select with a class of select-css

Notes on the CSS

The CSS for this is fine to use as-is, but if you're editing it at all, you might want to be aware of a few numbers and values that help it look right.

  • The select is set to display: block by default but you can style it display: inline-block; width: auto; if you'd like it to sit alongside a label.
  • The background of the select is created using two background images: the first is an svg arrow icon (expressed inline as a data URI) and the second is a repeating linear gradient. Either URL could be an external image if you'd like. If you change the icon image, be aware that its size is set in the first section of the later background-size: .65em auto, 100%; property. And its position is set via background-position: right .7em top 50%, 0 0; (which is .7em from the right side, respectively). Also, if the size changes, you might want to make more right padding on the button so that it doesn't overlap the select's text, but be aware that in IE9 and older, the custom arrow will not appear, and the browser's default arrow will show to the left of the padding, so don't add too much there or IE9's arrow will be inset really far.
  • The linear gradient background is important to keep, because its presence actually prevents IE9 and older from recognizing the background property, and as a result it won't show the custom icon alongside its unhideable native one. If you want a flat color, use a linear gradient between two of the same color values.
  • The appearance rule and its and prefixed versions are important to unset some default browser select styling.
  • The font-size: 16px; rule is important because iOS Safari will zoom-in the site layout if the select's text is less than 16px. Generally, this behavior is annoying so we try to avoid it with a 16px font size on selects.
  • The .select-css option keeps option elements from inheriting the bold font weight of the select button itself.
  • As noted in Scott O'Hara's article, setting background color on the select (though not background image as I've used here, can cause option elements to inherit background colors as well, which can cause problems. So avoid doing that. )
  • The .select-css::-ms-expand rule instructs IE11 and IE10 to hide the menu icon pseudo element, so the custom icon behind it can appear. Thanks for the tip, Jelmer de Maat.

For Posterity:

If you’re looking for a custom select that uses JavaScript for additional features, check out select.

  • 作用 user-select 的CSS属性控制用户是否可以选择文本。 属性和效果 text:默认 默认、可选择 auto:全自动~ 自动 在 ::before 和 ::after 伪元素上,属性值为none 如果元素是可编辑的(例如input文本框),则属性值是contain 否则,如果此元素的父级的使用值的 all,则使用值是 all 否则,如果此元素的父级的使用值的 none,则使用值是 no

  • 最近项目中用到了树结构的下拉框 写好以后发现 el-select-dropdown__wrap 哪怕使用深度选择器也修改不了,经过查找各种资料 最后发现渲染后的dom元素就不在#app元素内部 知道问题以后就好解决了 el-select 上加上 :popper-append-to-body=“false” 属性用于将渲染后的元素放入#app元素 这时候在使用深度选择器就可以了

  • .noselect {     -webkit-touch-callout: none;     -webkit-user-select: none;     -khtml-user-select: none;     -moz-user-select: none;     -ms-user-select: none;     user-select: none; }

  • 这是一款使用html5 svg和css3制作的炫酷select下拉菜单美化效果。我们可以通过JavaScript库来将表单中的input元素修改为更加好看的样式,甚至是更复杂的input元素,例如select下拉菜单。我们可以有非常多的表单美化方案,使用户可以得到更加好的用户体验。 在demo中我们使用了下面的字体图标:Ionicons和Font Awesome。 其中一个demo中使用的SVG国

  • import parsel import requests 语法使用 url = 'http://www.baidu.com' response = requests.get(url) selector = parsel.Selector(response.text) 选择所有元素 selector.css('*') 1、选择article元素 html = selector.css('

  • 访问地址:https://pan.baidu.com/s/1_btiUlu3G4W6PZt7Hc9VHA 密码:crqm

 相关资料
  • 我的DB MySQL上有这样的情况: 表_A Cod |值1 |值2 |值3 TABLE_B 鳕鱼|价值4|价值5 表C Cod |值6 我使用这个查询: 一切都很好,但是现在我必须从TABLE_A中选择元素(与TABLE_B和TABLE_C连接)并与TABLE_A上的一个元素连接。 例如,当时,当时,也选择和时,则相反。 编辑:(从OP的评论中添加): 我的查询结果 例如:(< code > 1

  • Select editor should be considered an example how to write editors rather than used as a fully featured editor. It is a much simpler form of the Dropdown editor. It is suggested to use the latter in y

  • Select ion-select和html中的select有点相似。 单选 <ion-item> <ion-label>Gender</ion-label> <ion-select [(ngModel)]="gender"> <ion-option value="f" checked="true">Female</ion-option> <ion-option value

  • 1.5.0 新增 Select 组件,用于单项选择。 注: 由于此组件依赖 Picker 组件,而 Picker 组件是基于 create-api 实现,所以在使用之前,请确保自己了解过 create-api。 示例 基本用法 对于 Select 选择组件,你需要传入 options 定义各个选项,选择的结果则绑定在 v-model 上。 <cube-select v-model="value

  • 描述 (Description) 此函数将输出的默认文件句柄设置为FILEHANDLE,如果未指定文件句柄,则设置由打印和写入等功能使用的文件句柄。 如果未指定FILEHANDLE,则返回当前默认文件句柄的名称。 select (RBITS, WBITS, EBITS, TIMEOUT ) )使用指定的位调用系统函数select()。 select函数设置用于处理非阻塞I/O请求的控件。 返回标量

  • SELECT index 切换到指定的数据库,数据库索引号 index 用数字值指定,以 0 作为起始索引值。 默认使用 0 号数据库。 可用版本: >= 1.0.0 时间复杂度: O(1) 返回值: OK redis> SET db_number 0 # 默认使用 0 号数据库 OK redis> SELECT 1 # 使用 1 号数据库 OK