Html/タブデザイン
提供: 初心者エンジニアの簡易メモ
tab.html
<link rel="stylesheet" type="text/css" href="/css/tab.css" /> <!-- #publictab --> <div id="publictab"> <ul> <li><a class="off" href="/" title="ホーム">ホーム</a></li> <li><a class="off" href="/wordlist" title="人気ワード">人気ワード</a></li> <li><a class="on" href="/help" title="ヘルプ">ヘルプ</a></li> <li class="space">右端テキスト</li> </ul> <div class="clear"></div> </div> <!-- /#publictab --> <!-- #privatetab --> <div id="privatetab"> <ul> <li><a class="on" href="/ranking/monthly">月間</a></li> <li><a class="off" href="/ranking/total">総合</a></li> </ul> <div class="clear"></div> </div> <!-- /#privatetab --> <!-- #private2tab --> <div id="private2tab"> <ul> <li><a class="on" href="/ranking/monthly/3">3月</a></li> <li><a class="off" href="/ranking/monthly/2">2月</a></li> </ul> <div class="clear"></div> </div> <!-- /#private2tab -->
tab.css
@charset "UTF-8"; /* publictab */ div#publictab { margin: 0px 0px 0px 0px; padding-left: 0px; text-align:left; width: 100%; border-bottom: 4px solid #000000; font-size:12px; } div#publictab ul { margin: 0px; padding: 0px; list-style-type: none; text-align:right; } div#publictab li { text-align: center; display: block; float: left; margin: 0px 0px 0px 5px; padding: 0px; } div#publictab li a { line-height: 22px; width: 120px; display: block; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-left: 1px solid #cccccc; text-decoration: none; font-weight: bold; } div#publictab li a.off { color: DarkBlue; background: WhiteSmoke; } div#publictab li a:hover { text-decoration: underline; } div#publictab li a:hover.off { color: White; background: LightSteelBlue; } div#publictab li a.on{ color: White; background: #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-left: 1px solid #000000; } /* /publictab */ /* privatetab */ div#privatetab { width: 100%; border-top: 2px solid #000000; background: #000000; } div#privatetab ul { margin: 0px; padding: 0px; list-style-type: none; } div#privatetab li { text-align: center; display: block; float: left; margin: 0px 5px; padding: 0px; } div#privatetab li a { line-height: 20px; width: 130px; padding: 0px 10px; display: block; text-decoration: none; font-weight: bold; border-top: 1px solid WhiteSmoke; border-right: 1px solid WhiteSmoke; border-left: 1px solid WhiteSmoke; } div#privatetab li a.off { color: #ffffff; } div#privatetab li a:hover { text-decoration: underline; } div#privatetab li a:hover.off { color: White; background: LightSteelBlue; } div#privatetab li a.on{ color: DarkBlue; background: White; } /* /privatetab */ /* private2tab */ div#private2tab { margin: 5px 0px; padding-left: 5px; text-align:left; width: 100%; font-size:12px; } div#private2tab ul { margin: 0px; padding: 0px; list-style-type: none; text-align:right; } div#private2tab li { text-align: center; display: block; float: left; margin: 0px 0px 0px 5px; padding: 0px; } div#private2tab li a { line-height: 22px; width: 110px; display: block; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; text-decoration: none; font-weight: bold; } div#private2tab li a.off { color: DarkBlue; background: WhiteSmoke; } div#private2tab li a:hover { text-decoration: underline; } div#private2tab li a:hover.off { color: White; background: LightSteelBlue; } div#private2tab li a.on{ color: White; background: #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-left: 1px solid #000000; border-bottom: 1px solid #000000; } /* /private2tab */ /* float clear */ div#publictab .clear, div#privatetab .clear { font-size: 0px; line-height: 0px; display: block; height: 0px; margin: 0px; padding: 0px; clear: both; } /* /float clear */ /* space */ div#publictab .space, div#privatetab .space { float: right; margin: 0px; padding: 0px; } /* /space */ /* form&input */ div#publictab form, div#privatetab form, div#publictab input, div#privatetab input { margin: 0px; padding: 0px; } /* /form&input */