我在製作一個選項卡,其菜單由.png
組成。我使用的標籤有輸入來顯示正確的選項卡。主動造型
該.pngs有一個hover-class
但我試圖在標籤處於活動狀態時保持活動狀態。
你認爲這有可能嗎?
.tabs {
width: 100%;
max-width: 1290px;
float: none;
list-style: none;
padding: 0;
margin: 75px auto;
}
.tabs li {
display: block;
}
.labels:after {
content: '';
display: table;
clear: both;
}
.tabs label {
display: inline-block;
margin: 0px;
height: 120px;
padding: 0px 10px;
color: #000;
font-size: 24px;
font-weight: normal;
cursor: pointer;
color: #F00;
}
.tab-img {
margin: auto 5px;
width: 100%;
vertical-align: middle;
}
.rounded:hover {
border-style: solid;
border-width: medium;
border-color: #3bbdbc;
border-radius: 60px;
margin: 5px;
}
.tab-contener {
display: none;
width: 100%;
padding: 15px;
}
.tab-contener h2 {
text-align: center;
}
.tab-contener p {
text-align: center;
font-size: 14px;
}
.tabs input[type=radio] {
display: none;
}
[id^=tab]:checked ~ div[id^=tab-contener] {
display: block;
}
[id^=tab]:checked ~ [id^=label] {
background: #08C;
color: white;
}
<head>
<link rel="stylesheet" type="text/css" href="artist-tab.css" media="screen" />
</head>
<ul class="tabs">
<li class="labels">
<div style="text-align: center; margin-left: auto; margin-right: auto;">
<label id="label1" for="tab1">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-leemo.png" alt="artiste leemo" width="95px" height="95px" />
</label>
<label id="label2" for="tab2">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-florent-bodart.png" alt="artiste florent bodart" width="95px" height="95px" />
</label>
<label id="label3" for="tab3">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-elisabeth-fredriksson.png" alt="artiste Elisabeth Fredriksson" width="95px" height="95px" />
</label>
<label id="label4" for="tab4">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-bleak-design.png" alt="artiste bleak design studio" width="95px" height="95px" />
</label>
<label id="label5" for="tab5">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-andreas-lie.png" alt="artiste andreas lie" width="95px" height="95px" />
</label>
<label id="label6" for="tab6">
<img class="rounded" src="http://labellegalerie.co/img/cms/home-artiste/artiste-andrew-paranavitana.png" alt="artiste andrew paranavitana" width="95px" height="95px" />
</label>
</div>
</li>
<li>
<input id="tab1" checked="checked" name="tabs" type="radio" />
<div id="tab-contener1" class="tab-contener">
<h3>Tab 1</h3>
</div>
</li>
<li>
<input id="tab2" name="tabs" type="radio" />
<div id="tab-contener2" class="tab-contener">
<h3>Tab 2</h3>
</div>
</li>
<li>
<input id="tab3" name="tabs" type="radio" />
<div id="tab-contener3" class="tab-contener">
<h3>Tab 3</h3>
</div>
</li>
<li>
<input id="tab4" name="tabs" type="radio" />
<div id="tab-contener4" class="tab-contener">
<h3>Tab 4</h3>
</div>
</li>
<li>
<input id="tab5" name="tabs" type="radio" />
<div id="tab-contener5" class="tab-contener">
<h3>Tab 5</h3>
</div>
</li>
<li>
<input id="tab6" name="tabs" type="radio" />
<div id="tab-contener6" class="tab-contener">
<h3>Tab 6</h3>
</div>
</li>
</ul>
是的,我認爲這是可能的。 – connexo