octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="wrapper">
  <div class="trail1div">
    
     <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Dropdown</a>
          <ul>
            <li><a href="#">Hello</a></li>
            <li><a href="#">Albatross</a></li>
            <li><a href="#">Iron man 3 will be released later this year</a></li>
          </ul></li>
        <li><a href="#">Products &amp; Services</a></li>
        <li><a href="#">News &amp; Events</a></li>
     </ul>
   
  </div><!--end trail1div-->
</div>
            
          
!
            
              
.wrapper {
  width: 980px;
  margin: 0 auto;
  font-family: arial;
  font-size: 11px;
xxcolor: #000; /* not used? */
xxtext-align: left; /* not needed, default */
}

.trail1div {
  margin: 0 0 20px 0;
}

.trail1div ul{
  margin: 0;
  padding: 0;
xxdisplay: block; /* not needed, default */
  list-style: none;
  background: #272822;
}

.trail1div ul li {
  float: left;
  display: block;
  border-right: 1px solid #0c0c0a;
  position: relative;
}

.trail1div ul li a {
  display: block;
  padding: 10px 25px;
  font-family: Arial;
  font-size: 12px;
  color: #fff;
xxtext-align: left; /* not needed */
  outline: none;
  text-decoration: none;
  border-right: 1px solid #31332b;
}

.trail1div ul li:hover {
  background: #3b3d34;
}

/*my trial */
.trail1div ul:after {
  clear: both;
  content: '';
  display: block;
 }

/* not needed, you contain floats above
.trail1div:after {
  clear: both;
  content: '';
  display: block;
 } */

ul li ul {
  position: absolute;
xxtop: auto; /* not needed, default */
  left: 0;
xxheight: auto; /* not needed, default */
xxwidth: 280px; /* ugly indeed */
} /* this width will be the width/area widthin which if the mouse is present, the dropdown wil be visible. If the content is lesser the ul will resize accordingly, but willl not exceeed in length beyond this max width  */

.trail1div ul li ul {
xxmargin: 0; /* not needed, declared above */
xxpadding: 0; /* not needed, declared above */
  display: none;
xxlist-style: none; /* not needed, declared above */
xxbackground: #272822; /* not needed, declared above */
xxfloat: left; /* not needed */
}

.trail1div ul li ul li {
  float: none;
  display: block;
  border-bottom: 1px solid #31332b;
  border-right: none;
  white-space: nowrap; /* <-- here's what you need! */
}

.trail1div ul li ul li a {
  border-bottom: 1px solid #0c0c0a;
  border-right: none;
}

/* shows dropdown */
.trail1div ul li:hover ul {
  display:block;
}


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console