网站首页
高清电影
无损音乐
游戏攻略
电脑教程
破解资源
站长资源
软件下载
CSS 扑克牌效果实现代码
(编辑:jimmy 日期: 2025/1/11 浏览:
2
)
非常不错的效果代码。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>BrainJar.com: Playing Cards with CSS</title> <meta http-equiv="Content-Type" content="text/html;charset=gb2312" /> <style id="cardStyles" type="text/css"> /****************************************************************************** * Styles for playing cards. * ******************************************************************************/ .card { background-image: url("graphics/cardback.gif"); border-color: #808080 #000000 #000000 #808080; border-width: 1px; border-style: solid; font-size: 20pt; position: absolute; width: 3.75em; height: 5.00em; } .front { background-color: #ffffff; color: #000000; position: absolute; width: 100%; height: 100%; } .red { color: #ff0000; } .index { font-size: 50%; font-weight: bold; text-align: center; position: absolute; left: 0.25em; top: 0.25em; } .ace { font-size: 300%; position: absolute; left: 0.325em; top: 0.250em; } .face { border: 1px solid #000000; position: absolute; left: 0.50em; top: 0.45em; width: 2.6em; height: 4.0em; } .spotA1 { position: absolute; left: 0.60em; top: 0.5em; } .spotA2 { position: absolute; left: 0.60em; top: 1.5em; } .spotA3 { position: absolute; left: 0.60em; top: 2.0em; } .spotA4 { position: absolute; left: 0.60em; top: 2.5em; } .spotA5 { position: absolute; left: 0.60em; top: 3.5em; } .spotB1 { position: absolute; left: 1.55em; top: 0.5em; } .spotB2 { position: absolute; left: 1.55em; top: 1.0em; } .spotB3 { position: absolute; left: 1.55em; top: 2.0em; } .spotB4 { position: absolute; left: 1.55em; top: 3.0em; } .spotB5 { position: absolute; left: 1.55em; top: 3.5em; } .spotC1 { position: absolute; left: 2.50em; top: 0.5em; } .spotC2 { position: absolute; left: 2.50em; top: 1.5em; } .spotC3 { position: absolute; left: 2.50em; top: 2.0em; } .spotC4 { position: absolute; left: 2.50em; top: 2.5em; } .spotC5 { position: absolute; left: 2.50em; top: 3.5em; } /****************************************************************************** * Miscellaneous styles. * ******************************************************************************/ body { background-color: #40a040; } </style> <script type="text/javascript">//<![CDATA[ var minSize = 8; function resizeCards(d) { var n; // Change the font size on the "card" style class. // DOM-compliant browsers. if (document.styleSheets[1].cssRules) { n = parseInt(document.styleSheets[1].cssRules[0].style.fontSize, 10); document.styleSheets[1].cssRules[0].style.fontSize = Math.max(n + d, minSize) + "pt"; // For NS 6.1, insert a dummy rule to force styles to be reapplied. if (navigator.userAgent.indexOf("Netscape6/6.1") >= 0) document.styleSheets[1].insertRule(null, document.styleSheets[1].cssRules.length); } // IE browsers. else if (document.styleSheets[1].rules[0]) { n = parseInt(document.styleSheets[1].rules[0].style.fontSize, 10); document.styleSheets[1].rules[0].style.fontSize = Math.max(n + d, minSize) + "pt"; } return false; } //]]></script> </head> <body> <!-- Normal page content. --> <div style="position:relative;margin-top:1em;"> <div class="card" style="left:0em;top:0em;"> <div class="front"> <div class="index">10♠</div> <div class="spotA1">♠</div> <div class="spotA2">♠</div> <div class="spotA4">♠</div> <div class="spotA5">♠</div> <div class="spotB2">♠</div> <div class="spotB4">♠</div> <div class="spotC1">♠</div> <div class="spotC2">♠</div> <div class="spotC4">♠</div> <div class="spotC5">♠</div> </div> </div> <div class="card" style="left:4em;top:0em;"> <div class="front red"> <div class="index">9♥</div> <div class="spotA1">♥</div> <div class="spotA2">♥</div> <div class="spotA4">♥</div> <div class="spotA5">♥</div> <div class="spotB3">♥</div> <div class="spotC1">♥</div> <div class="spotC2">♥</div> <div class="spotC4">♥</div> <div class="spotC5">♥</div> </div> </div> <div class="card" style="left:8em;top:0em;"> <div class="front"> <div class="index">8♣</div> <div class="spotA1">♣</div> <div class="spotA3">♣</div> <div class="spotA5">♣</div> <div class="spotB2">♣</div> <div class="spotB4">♣</div> <div class="spotC1">♣</div> <div class="spotC3">♣</div> <div class="spotC5">♣</div> </div> </div> <div class="card" style="left:12em;top:0em;"> <div class="front red"> <div class="index">7♦</div> <div class="spotA1">♦</div> <div class="spotA3">♦</div> <div class="spotA5">♦</div> <div class="spotB2">♦</div> <div class="spotC1">♦</div> <div class="spotC3">♦</div> <div class="spotC5">♦</div> </div> </div> <div class="card" style="left:16em;top:0em;"> <div class="front"> <div class="index">6♠</div> <div class="spotA1">♠</div> <div class="spotA3">♠</div> <div class="spotA5">♠</div> <div class="spotC1">♠</div> <div class="spotC3">♠</div> <div class="spotC5">♠</div> </div> </div> <div class="card" style="left:20em;top:0em;"> <div class="front red"> <div class="index">5♥</div> <div class="spotA1">♥</div> <div class="spotA5">♥</div> <div class="spotB3">♥</div> <div class="spotC1">♥</div> <div class="spotC5">♥</div> </div> </div> <div class="card" style="left:0em;top:6em;"> <div class="front"> <div class="index">4♣</div> <div class="spotA1">♣</div> <div class="spotA5">♣</div> <div class="spotC1">♣</div> <div class="spotC5">♣</div> </div> </div> <div class="card" style="left:4em;top:6em;"> <div class="front red"> <div class="index">3♦</div> <div class="spotB1">♦</div> <div class="spotB3">♦</div> <div class="spotB5">♦</div> </div> </div> <div class="card" style="left:8em;top:6em;"> <div class="front"> <div class="index">2♠</div> <div class="spotB1">♠</div> <div class="spotB5">♠</div> </div> </div> <div class="card" style="left:12em;top:6em;"> <div class="front red"> <div class="index">A♥</div> <div class="ace">♥</div> </div> </div> </div> </body> </html>
提示:您可以先修改部分代码再运行
上一篇:
CSS+DIV 拼图(26个英文字母)
下一篇:
IE与Firefox中兼容的html设计中使用CSS改变鼠标为手形
一句话新闻
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。
最新资源
群星《奔赴!万人现场 第2期》[FLAC/分轨][518.8
群星《奇妙浪一夏 (上海迪士尼度假区音乐)》[32
群星《奇妙浪一夏 (上海迪士尼度假区音乐)》[FL
【古典音乐】詹姆斯·高威《季节》1993[WAV+CUE]
贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]
小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
群星《欢迎来到我身边 电影原声专辑》[320K/MP3
群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨
雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓
群星《2024好听新歌42》AI调整音效【WAV分轨】
首页
音乐
电影
资源