input的radio 样式兼容(ios中的hover)

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            .condition input {
                display: inline-block;
                vertical-align: middle;
                /* 当成为行内块元素时它就可以垂直居中了 */
                width: 20px;
                height: 20px;
                -webkit-appearance: none;
                /* 清除原有的样式 */
                background-color: transparent;
                border: 0;
                outline: 0 !important;
                /* 去掉点击后外面可能会出现的蓝框 */
                line-height: 20px;
                color: #d8d8d8;
            }

            .condition input:after {
                /* //在input的内容之后插入新内容 */
                content: "";
                display: block;
                width: 20px;
                height: 20px;
                border-radius: 50%;
                text-align: center;
                line-height: 14px;
                font-size: 16px;
                color: #fff;
                border: 3px solid #ddd;
                background-color: #fff;
                box-sizing: border-box;
                /* 规定两个并排的带边框的框 */
            }

            .condition input:checked:after {
                /* 选中之后的样子 */
                content: "L";
                transform: matrix(-0.766044, -0.642788, -0.642788, 0.766044, 0, 0);
                /* 2D变换旋转,还有平移和缩放,平时旋转用rotate,这个写法是比较复杂一点的写法,
括号里面的六个值来得矩阵,实现2D变换,更详细的大家去百度查。 */
                -webkit-transform: matrix(-0.766044, -0.642788, -0.642788, 0.766044, 0, 0);
                border-color: #099414;
                background-color: #099414;
            }
        </style>
    </head>
    <body>
        <div class="condition">
            <input name="sex" type="radio">
            <input name="sex" type="radio">
        </div>
    </body>
</html>

原文地址:https://www.cnblogs.com/fanting/p/9876785.html

时间: 2024-07-30 15:14:11

input的radio 样式兼容(ios中的hover)的相关文章

利用css3修改input[type=radio]样式

<form> <div> <input id="item1" type="radio" name="item" value="选项一" checked> <label for="item1"></label> <span>选项一</span> </div> <div> <input id=&qu

纯css兼容个浏览器input[type=&#39;radio&#39;]不能自定义样式

各个浏览器对于表单input[type='radio'].input[type='checkbox']的样式总是各有差异 //html <div class="remember-account"> <input type="checkbox"> <span>记住账号</span> </div> //css .remember-account { display: inline-block; font-siz

如何更改 iOS 和安卓浏览器上的 input[type=&quot;radio&quot;] 元素的默认样式?

Safari 上的默认样式是这样的, 背景颜色可以使用background-color改变,但中间那个点始终无法去掉. 我查了一些jQuery插件,如iCheck.js,但是那说明写得我都看不明白,根本不知道如何使用. 还有-webkit-appearance:none;属性会直接将input[type="radio"]元素隐藏. 应该如何更改?我的目标只是一个选中时是纯色的圆形,未选中时是带边框的透明圆形. 还可用css伪类写 <h3>CSS3 Custom radio&

自定义input[type=&quot;radio&quot;]的样式

对于表单,input[type="radio"] 的样式总是不那么友好,在不同的浏览器中表现不一. 为了最大程度的显示出它们的差别,并且为了好看,首先定义了一些样式: html: <form action=""> <div class="sex"> <div class="female"> <label for="female">女</label>

css input checkbox和radio样式美化

css input checkbox和radio样式美化 2014年9月1日 132495次浏览 在之前的一篇文章中,我已经介绍了input file上传按钮的美化,地址:http://www.haorooms.com/post/css_input_uploadmh ,今天,我们来讲一下checkbox美化和radio美化,关于select下拉框的美化的话,要用一个jquery插件了,这个插件后面我们再讲!急用的同学可以留言! 但是像checkbox美化和radio美化,input美化,根本就不

【前端】input radio多选事件获取所有选中的id,radio样式优化可修改

$("#all_button").on('click', function() { obj = document.getElementsByClassName("input_radio_checked"); str = ""; for(i = 0; i < obj.length; i++) { str += obj[i].id + " "; //这里是数字之间的空格 } console.log(str) alert(st

input[type=&quot;radio&quot;]自定义样式

input为radio时,虽然会有默认选中的样式,但是并不符合大多数项目的需求,我们的目标是可以随心所欲自定义它的样式.怎么做呢?其实很简单,只要抓住3点.分别是1.label 2.隐藏自带样式 3.绘制我们的样式. 首先,我们准备了一个简单的选中样式,看图: 下面我们看看怎么实现 1.label 我们都知道,label可以和input关联,达到点击label就触发input的效果. 既然这样,我们就要充分的利用它. <label for="cat" class="ra

iOS中字体样式的设置、颜色、空心、删除线、阴影、斜体、扁平化

不多说直接上代码! 这些知识基本的文字设置,实际上iOS中文字的设置有很多,比如说颜色.空心.删除线.阴影.斜体.扁平化等, NSStrokeWidthAttributeName这个属性所对应的值是一个 NSNumber 对象(小数).该值改变描边宽度(相对于字体size 的百分比).默认为 0,即不改变.正数只改变描边宽度.负数同时改变文字的描边和填充宽度.例如,对于常见的空心字,这个值通常为3.0. 同时设置了空心的两个属性,并且NSStrokeWidthAttributeName属性设置为

form中 单选框 input[type="radio"] 分组

在form中有时候需要给单选框分组,这种情况下 可以通过给单选框设置相同的name来进行分组: <html> <head> <title> </title> </head> <meta charset="utf-8"> <body> <form action="" method=""> <!--通过name将他们分组--> <inpu