惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
V
Visual Studio Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
C
Comments on: Blog
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
A
Arctic Wolf
有赞技术团队
有赞技术团队
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
Webroot Blog
Webroot Blog
C
Cisco Blogs
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
博客园 - 叶小钗
K
Kaspersky official blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
H
Hacker News: Front Page
D
Darknet – Hacking Tools, Hacker News & Cyber Security
D
Docker
P
Palo Alto Networks Blog
The Register - Security
The Register - Security
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志

博客园 - sonkoto

HTML5添加的一些常用新标签 css判断ie浏览器 [jQuery] table表格 [jQuery] menu_Sliding(menu 滑动) [jQuery]animated-hover [jQuery]animate(滑块滑动) [jQuery]图片更换 [jQuery] simple-disappear (消失的例子)——【转】 [转]jQuery formValidator【表达校验插件】 table Editor[table排序] [jQuery] jQuery Plugins by Dylan Verheul [转]jQuery源码解读---执行过程分析 [JQuery Cycle Plugin] 图片轮换 [jQuery] 漂亮的menu+样式表切换 JQuery Cycle Plugin (jQuery循环插件_图片轮换) [转]JQuery效果展示--不看后悔N辈子 [转]【★】javascript 常用代码 超经典! 【转】jQuery下拉框,单选框,多选框整理 Flash:百叶窗 效果
[转]DOV+CSS表单:超炫的单选框与复选框效果!
sonkoto · 2008-06-12 · via 博客园 - sonkoto

转自:http://www.52css.com/article.asp?id=366

在DIV+CSS构建的网页中,表单一直是一个比较头疼的问题,表单的布局与样式的定义还需要更多的学习与思考,今天介绍一款CSS表单,超炫的单选框与复选框效果。非常棒的感觉,希望对大家以后的布局有参考意义。
  我们看正常情况下此表单的效果:


我们看经过CSS样式定义后的效果:

实现这样的效果,作者除了对表单元素进行样式定义,还用JS对其进行了控制。
  点击下面的链接,查看运行效果:
  http://www.52css.com/attachments/month_0703/366/52css_com.html

我们看下面的CSS代码:

Example Source Code [www.52css.com]
/* Off state for a ARC checkbox */
#labcontent .checkboxOff {
    display: inline;
    margin: 0px;
    padding: 2px; /* NS 6 problem */
    padding-left: 20px;
    color: #666;
    line-height: 16px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: .8em;
    background-image: url(checkbox_off.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
}
/* On state for a ARC checkbox */
#labcontent .checkboxOn {
    display: inline;
    margin: 0px;
    padding: 2px; /* NS 6 problem */
    padding-left: 20px;
    color: #000;
    line-height: 16px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: .8em;
    background-image: url(checkbox_on.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
}

/* Off state for a ARC checkbox */
#labcontent .altCheckboxOff {
    display: inline;
    padding: 20px 2px; /* NS 6 problem */
    padding-left: 70px;
    color: #666;
    line-height: 60px;
    font-family: "Courier New", Courier, mono;
    font-size: 1.2em;
    background-image: url(alt_checkbox_off.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
    cursor: pointer;
}
/* On state for a ARC checkbox */
#labcontent .altCheckboxOn {
    display: inline;
    padding: 20px 2px; /* NS 6 problem */
    padding-left: 70px;
    color: #000;
    line-height: 60px;
    font-family: "Courier New", Courier, mono;
    font-size: 1.2em;
    font-weight: bold;
    background-image: url(alt_checkbox_on.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
}

/* Off state for a ARC radio button */
.radioOff {
    display: inline;
    margin: 0px;
    padding: 2px;
    padding-left: 20px;
    color: #666;
    font: .8em/16px Verdana,Arial,Helvetica;
    background: transparent url(off.gif) no-repeat 0% 50%;
}
/* On state for a ARC radio button */
.radioOn {
    display: inline;
    margin: 0px;
    padding: 2px; /* NS 6 problem */
    padding-left: 20px;
    color: #000;
    font: .8em/16px Verdana,Arial,Helvetica;
    background: transparent url(on.gif) no-repeat 0% 50%;
}
/* use CSS to full effect with hover states. Ohhh, perty! */
.radioOn:hover {
    background-image: url(on_hover.gif);
}
.radioOff:hover {
    color: #333 !important;
    background-image: url(off_hover.gif);
}

/* Alternative Off state for a ARC radio button */
.altRadioOff {
    display: inline;
    margin: 0px;
    padding: 2px;
    padding-left: 20px;
    color: #000;
    line-height: 16px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 0.8em;
    background-image: url(alt_off.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
    cursor: pointer;
}
/* Alternative On state for a ARC radio button */
.altRadioOn {
    display: inline;
    margin: 0px;
    padding: 2px; /* NS 6 problem */
    padding-left: 20px;
    line-height: 16px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: .8em;
    background-image: url(alt_on.gif);
    background-repeat: no-repeat;
    background-position: 0% 50%;
    border: 0px;
    cursor: pointer;
    text-decoration: underline;
}