タブメニュー自作 コード css

マイナスマージンが決め手
オーバーフロー hidenも注意 使わない

1
2
3
4
5
6
7
8
<!------------------タブ店舗全ページ---------------------------------->
<ul class="tab_menu">
<li><a href="<?php echo home_url(); ?>/?page_id=34" class="current">尾張旭店</a></li>
<li><a href="<?php echo home_url(); ?>/?page_id=37">日進店</a></li>
<div style="clear:both"></div>
</ul>
 
<!------------------/タブ店舗全ページ---------------------------------->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*タブ*/
 
.tab_menu{
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #CCC;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 10px;
    margin-top: 10px;
    margin-right: 0px;
    margin-bottom: 30px;
    margin-left: 0px;
}
.tab_menu li{
    float: left;
    list-style-type: none;
    margin-bottom: -1px;
    margin-left: -1px
 
}
.tab_menu li a{
    display: block;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: #CCC;
    border-right-color: #CCC;
    border-bottom-color: #CCC;
    border-left-color: #CCC;
    padding-top: 5px;
    padding-right: 25px;
    padding-bottom: 5px;
    padding-left: 25px;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
}
 
.tab_menu li a:hover{
    color: #FFF;
    background-color: #00A550;
    text-decoration: none;
}
 
.tab_menu li a.current{
    background-color: #6a3906;
    color: #FFF;
    border-bottom-color: #FFF;
}