问答详情
源自:1-4 使用radio制作导航(添加样式)

我的几个单选只显示了一个,那个单选位置有问题,但我又找不到问题所在

.clr{

width:0;

height:0;

overflow:hidden;

clear:both;

padding:0;

margin:0;

}

.st-container{

width:100%;

height:100%;

position:absolute;

left:0;

top:0;

font-family:Microsoft;

}


.st-container > input,

.st-container > a{

width:33%;

height:40px;

line-height:40px;

position:fixed;

top:0;

}

.st-container > input{

opacity:1;

z-index: 1000;

}

.st-container > a{

z-index: 10;

font-weight:700;

font-size:16px;

background:#e23a6e;

text-align:center;

color:#fff;

text-shadow:1px 1px 1px rgba(151,24,64,0.2); 

}

#st-control-1,#st-control-1 + a{

left:0%;

}

#st-conrrol-2,#st-control-2 + a{

left:33%;

}

#st-conrrol-3,#st-control-3 + a{

left:66%;

}

.st-container input:checked + a{

background:#821134;

}


提问者:慕粉4379063 2016-11-30 22:08

个回答

  • qq_锐哥_0
    2016-12-03 14:42:43
    已采纳

    .st-container input:nth-of-type(1),#st-control-1+a

    {

    left:0%;

    }

    .st-container input:nth-of-type(2),#st-control-2+a

    {

    left:33%;

    }

    .st-container input:nth-of-type(3),#st-control-3+a

    {

    left:66%;

    }

    改成这段

  • qq_锐哥_0
    2016-12-03 14:46:36

    刚刚发现你单词写错了,是control