JSFiddle - React, Tailwind, and code Playground

by Sam G

HTML

<div id="header"></div>
<div id="container">
    <div id="lnav_container">
        <ul id="lnav">
            <li class="lnav_item"> <a href="#">Item 1</a></li>
            <li class="lnav_item"> <a href="#">Item 2</a></li>
            <li class="lnav_item"> <a href="#">Item 3</a></li>
            <li class="lnav_item"> <a href="#">Item 4</a></li>
        </ul>
    </div>
    <div id="content">
        <div id="test"></div>
    </div>
</div>

CSS

body {font-family: Helvetica, Arial, sans-serif;}
#header {
    width: 600px;
    height: 80px;
    background-color: black;
}
#container {
    width: 600px;
}
#lnav_container {
    width: 20%;
    height: 280px;
    float: left;
    padding: 0px;
    background-color: gray;
}
#lnav {
    margin: 0px;
    padding: 10px;
    list-style-type: none;
    text-align: center;
}
.lnav_item {
    width: 74%;
    margin-top: 10px;
}
.lnav_item:first-child {margin-top: 0px;}
.lnav_item.selected {width: 86%;}
.lnav_item a {
    display: inline-block;
    width: 100%;
    line-height: 30px;
    padding: 8px 5px 5px 0px;
    background-color: yellow;
    color: black;
    font-weight: bold;
    text-decoration: none;
    border-radius: 2px 12px 12px 2px;
}
.lnav_item.selected a {
    background-color: green;
    color: white;
    font-size: 18px;
}
.lnav_item:hover a{background-color: orange;}

#content {
    width: 79%;
    height: 280px;
    float: right;
    background-color: blue;
    color: white;
}
#test {
    line-height: 100px;
    font-weight: bold;
    font-size: 32px;
    padding: 40px;
    text-align: center;
}

JavaScript

$('.lnav_item a').on('click', function () {
    $('.lnav_item').removeClass('selected');
    var str = $(this).text() + " clicked!";
    $('#test').html(str);
    $(this).parent().addClass('selected');
});