Create Horizontal Accordion Menu using only Css | Sanwebcorner

Create Horizontal Accordion Menu using only Css

Accordion Menu always very simple to create at a same time this is very useful to heighlight the text and also content compressing because it hides and shows the particular menu content so it is very efficiant way to avoid the maximum space in the webpages.

In this example i am going to tell you how to create the Horizontal Accordion Menu using css and css3. Usually all are using the vertical accordion menu. But it is Horizontal accordion menu, It is more attractive when comparing to the vertical one. This is also responsive type horizontal Menu.

Normal Vertical Accordion Menu is Here.

This was done by using only css3 and html, so it is very easy and simple to implement. The below image shows the how the horizontal accordion menu is looking for, And also code and demo page available to testing purpose. I hope this post is very useful.

Html code for Horizontal Accordion Menu:

<h1>Horizontal Accordion Menu using css3</h1>
<div class="san-h-adn">
<form>
<ul>
<li>
<input type="radio" name="group-01" id="group-01-01" />
<label for="group-01-01">Accordion Menu-1</label>
<div>
<h3>Accordion Menu-1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
<li>
<input type="radio" name="group-01" id="group-01-02" checked="checked" />
<label for="group-01-02">Accordion Menu-2</label>
<div>
<h3>Accordion Menu-2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
<li>
<input type="radio" name="group-01" id="group-01-03" />
<label for="group-01-03">Accordion Menu-3</label>
<div>
<h3>Accordion Menu-3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
<li>
<input type="radio" name="group-01" id="group-01-04" />
<label for="group-01-04">Accordion Menu-4</label>
<div>
<h3>Accordion Menu-4</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
<li>
<input type="radio" name="group-01" id="group-01-05" />
<label for="group-01-05">Accordion Menu-5</label>
<div>
<h3>Accordion Menu-5</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
<li>
<input type="radio" name="group-01" id="group-01-06" />
<label for="group-01-06">Accordion Menu-6</label>
<div>
<h3>Accordion Menu-6</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.</p>
</div>
</li>
</ul>
</form>
</div>
<h2><a href="http://www.sanwebcorner.com/">www.sanwebcorner.com</a></h2>

Css for Horizontal Accordion Menu

.san-h-adn,
.san-h-adn > form > ul > li > div,
.san-h-adn > form > ul > li > label
{
overflow: hidden;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.san-h-adn > form > ul,
.san-h-adn > form > ul > *
{
margin: 0;
padding: 0;
list-style: none;
}
.san-h-adn > form > ul,
.san-h-adn > form > ul > li > div
{
height: 220px; 
border: 2px solid #174919;
}
.san-h-adn,
.san-h-adn > form > ul > li > input:checked + label
{
background: #4CAF50;;
}
.san-h-adn > form > ul > li > input,
.san-h-adn > form > ul > li > label
{
position: absolute;
}
.san-h-adn > form > ul > li,
.san-h-adn > form > ul > li:last-child
{
border: solid 1px rgba(255,255, 255, .75);
}
.san-h-adn
{
font-family: 'Lato', sans-serif;
padding: 1px;
cursor: default;
}
p{
font-size:14px; 
line-height:26px;
text-align:justify;
}
.san-h-adn > form > ul > li > label
{
display: block;
width: 220px; 
padding: 0 8px;
letter-spacing: 1px;
font: bold 14px/32px "Lato";
background: #236E26;
color: #fff;
text-align: right;
cursor: pointer;
text-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
text-overflow: ellipsis;
white-space: nowrap;
-webkit-transition: all .3s cubic-bezier(.09, .11, .24, .91);
-moz-transition: all .3s cubic-bezier(.09, .11, .24, .91);
-ms-transition: all .3s cubic-bezier(.09, .11, .24, .91);
-o-transition: all .3s cubic-bezier(.09, .11, .24, .91);
transition: all .3s cubic-bezier(.09, .11, .24, .91);
-webkit-transform: translateX(-100%) rotate(-90deg);
-moz-transform: translateX(-100%) rotate(-90deg);
-ms-transform: translateX(-100%) rotate(-90deg);
-o-transform: translateX(-100%) rotate(-90deg);
transform: translateX(-100%) rotate(-90deg);
-webkit-transform-origin: right top;
-moz-transform-origin: right top;
-ms-transform-origin: right top;
-o-transform-origin: right top;
transform-origin: right top;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.san-h-adn > form > ul > li > input:not(:checked) + label:hover
{
background: #124f15;
}
.san-h-adn > form > ul > li > input:checked + label
{
border-bottom-color: transparent;
color: #ffffff;
}
.san-h-adn > form > ul > li
{
float: left;
padding: 0 32px 0 0;
border-right: 0;
}
.san-h-adn > form > ul > li > input
{
opacity: 0; 
}
.san-h-adn > form > ul > li > div
{
width: 0;
font-size: 10px;
color: #fff;
margin: 0 -32px 0 32px;
-webkit-transition: width .3s cubic-bezier(.09, .11, .24, .91);
-moz-transition: width .3s cubic-bezier(.09, .11, .24, .91);
-ms-transition: width .3s cubic-bezier(.09, .11, .24, .91);
-o-transition: width .3s cubic-bezier(.09, .11, .24, .91);
transition: width .3s cubic-bezier(.09, .11, .24, .91);
}
.san-h-adn > form > ul > li > input:checked ~ div
{
width: 460px;
padding: 15px;
overflow: auto;
}


Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll create random number Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form multi-select-checkbox Multi-Step-form Multiple File Upload in PHP mysql News ticker on hover change text to image our team page password generator password strength checker Photoshop PHP php mailer populate html selectbox Popup image on click the link pure css Question type form random number generate Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips whatsapp link website Youtube