Bu tabloyu nasıl yapabilirim? |
9 Mesajlar | 1.552 Okunma |
*, ::before, ::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-size: 16px;
line-height: 1.6;
font-weight: 400;
font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.table {
display: flex;
justify-content: center;
}
.table li {
padding: 0.8em 1.5em;
width: 200px;
background: #ebf0f6;
}
.table ul {
list-style: none;
}
.table__menu {
margin-right: 1em;
}
.table__menu li {
cursor: pointer;
outline: 0;
font-weight: 700;
background: #364e68;
color: #fff;
}
.table__menu li[aria-selected='true'] {
background: #132238;
color: #fff;
}
.table__menu li[aria-selected='true']:hover {
color: #fff;
}
.table__menu li:hover {
color: #132238;
}
.table__panel div[aria-hidden='true']:not(:nth-child(1)) {
display: none;
}
.table__panel div li {
width: 300px;
}
.table__panel div li[aria-selected='true'] {
color: red;
}
.table__panel div li:nth-child(odd) {
background: #98ccd3;
}
<script></script>
<script>
$(function() {
$("li[role='tab']").on("click", function(){
$("li[role='tab']").attr("aria-selected","false");
$(this).attr("aria-selected","true");
var tabpanid= $(this).attr("aria-controls");
var tabpan = $("#"+tabpanid);
$("div[role='tabpanel']").attr("aria-hidden","true").hide();
tabpan.attr("aria-hidden","false").show();
});
});
</script>