Hi,
I am designing a page with vertical tab. But I am not sure about how to achieve this design. I don't want to use any javascript, jquery etc. Planning to create separate views for each tab menu item. So i can change the active tab in each view. Please help to solve this issue. I don't have much code to post. Please provide some links to move in right direction.. Thanks in advance.
This is what i did to acheive the design
<style>
#content
{
background-color: #f2f2f2;
padding: 20px 10px;
overflow: auto;
}
#tab-container
{
float: left;
margin: 50px 0 0 0;
width: 126px;
}
#tab-container ul
{
list-style: none;
text-align: center;
}
#tab-container ul li
{
border-top: 1px solid #666;
border-right: 1px solid #666;
border-bottom: 1px solid #666;
border-left: 8px solid #666;
background-color: #ddd;
margin: 8px 0;
}
#tab-container ul li a,
#tab-container ul li a:visited
{
text-decoration: none;
color: #666;
display: block;
padding: 15px 5px;
}
#tab-container ul li:hover
{
border-left: 8px solid #333;
}
#tab-container ul li a:hover
{
color: #000;
}
#tab-container ul li.selected
{
border-right: none;
background-color: #fff;
border-left: 8px solid #006699;
}
#main-container
{
min-height: 400px;
margin: 0 0 0 125px;
padding: 20px;
background-color: #fff;
border: 1px solid #888;
}
</style>
<div id="content">
<div id="tab-container">
<ul>
<li class="selected"><a href="">Introduction</a></li>
<li><a href="">Html</a></li>
<li><a href="">CSS</a></li>
<li><a href="">JavaScript</a></li>
</ul>
</div>
<div id="main-container">
<h1>Put your content here...</h1>
</div>
</div>
may i sure below demo
useful for you;
DEMO
DEMO1
html
<div id="tabs">
<ul>
<li>
<a href="#a">Tab A</a>
</li>
<li>
<a href="#b">Tab B</a>
</li>
<li>
<a href="#c">Tab C</a>
</li>
<li>
<a href="#d">Tab D</a>
</li>
</ul>
<div id="a">
Content of A
</div>
<div id="b">
Content of B
</div>
<div id="c">
Content of C
</div>
<div id="d">
Content of D
</div>
</div>
css
.ui-tabs.ui-tabs-vertical {
padding: 0;
width: 42em;
}
.ui-tabs.ui-tabs-vertical .ui-widget-header {
border: none;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav {
float: left;
width: 10em;
background: #CCC;
border-radius: 4px 0 0 4px;
border-right: 1px solid gray;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li {
clear: left;
width: 100%;
margin: 0.2em 0;
border: 1px solid gray;
border-width: 1px 0 1px 1px;
border-radius: 4px 0 0 4px;
overflow: hidden;
position: relative;
right: -2px;
z-index: 2;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a {
display: block;
width: 100%;
padding: 0.6em 1em;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a:hover {
cursor: pointer;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
margin-bottom: 0.2em;
padding-bottom: 0;
border-right: 1px solid white;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li:last-child {
margin-bottom: 10px;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-panel {
float: left;
width: 28em;
border-left: 1px solid gray;
border-radius: 0;
position: relative;
left: -1px;
}
js
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript">
$('#tabs')
.tabs()
.addClass('ui-tabs-vertical ui-helper-clearfix');
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With