单选框,复选框,下拉列表的美化

本文主要探讨如何美化前端开发中的基础选择元素,包括单选框、复选框及下拉列表。通过实例链接提供了详细教程和参考资料,帮助开发者提升页面交互体验。
摘要由CSDN通过智能技术生成

参考:http://www.jq22.com/yanshi9351

这里写图片描述
这里写图片描述
这里写图片描述

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title></title>
        <style type="text/css">
            body {
                margin: 0;
                font: 16px/20px "宋体";
            }

            .box1 {
                width: 500px;
                height: 100px;
                line-height: 100px;
                margin: 0 auto;
                border: 1px solid red;
                text-align: center;
            }

            .box1 label {
                position: relative;
                padding-left: 20px;

            }

            .box1 input {
                visibility: hidden;
            }

            .box1 i {
                position: absolute;
                top: -2px;
                left: -2px;
                height: 19px;
                width: 19px;
                background: url('http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/radiobutton.gif') no-repeat -14px -18px;
            }

            .box1 label:hover {
                color: red;
            }

            .box1 label:hover i {
                background-position: -14px -118px;
            }

            .box1 label.selected1 i {
                background-position: -14px -218px;
            }
        </style>
        <style type="text/css">
            .box2 {
                width: 600px;
                height: 100px;
                line-height: 100px;
                margin: 0 auto;
                border: 1px solid black;
                text-align: center;
            }

            .box2 label {
                position: relative;
                padding-left: 20px;
            }

            .box2 input {
                visibility: hidden;
            }

            .box2 i {
                position: absolute;
                top: -2px;
                left: -2px;
                height: 19px;
                width: 19px;
                background: url('http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/checkbox.gif') no-repeat -14px -18px;
            }

            .box2 label:hover {
                color: red;
            }

            .box2 label:hover i {
                background-position: -14px -118px;
            }

            .box2 label.selected2 i {
                background-position: -14px -218px;
            }
        </style>
    </head>

    <body>
        <div class="box1" id="box1">
            单选一项游戏方式:
            <label for="xiu"><i></i>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值