如何设置输入类型复选框边框和背景? [英] how to set input type checkbox border and background?

查看:133
本文介绍了如何设置输入类型复选框边框和背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置一个输入类型复选框右侧填充到 10px border-right:1px solid#000 。我正在尝试这个,但复选框不采取的价值观。是否有人知道为什么它不工作?



我使用以下代码:

  input [type =checkbox] {
border-right:1px solid #fff;
margin-right:10px;
}

边框不占用。


<这是其中的一个元素,浏览器往往不会让你的风格这么多,并且大多数人用javascript替换它。


$

b $ b

为什么不给一个漂亮的复选框试一试? :)
http://www.no-margin-for- errors.com/projects/prettycheckboxes/



编辑



以下是一个示例: http://jsfiddle.net/v4Dde/2/ 这是我如何做了一次用javascript,希望它帮助你(对不起颜色只是让他们这样的方式,所以你可以看到:))


I need to set an input type checkbox right side padding to 10px and border-right:1px solid #000. I am trying this but the checkbox not taking the values. Does anybody know why it isn't working?

I am using the following code:

input[type="checkbox"] {
  border-right:1px solid #fff;
  margin-right:10px;
}

The border doesn't take.

解决方案

This is one of those elements what browsers tend not to let you style that much, and mostly people replace it with javascript.

Why dont you give pretty checkbox a try? :) http://www.no-margin-for-errors.com/projects/prettycheckboxes/

Edit:

Here is an example: http://jsfiddle.net/v4Dde/2/ this is how i made it once with out javascript, hope it helps you (sorry about the color just made them this way so you can see :) )

这篇关于如何设置输入类型复选框边框和背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆