www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] one CSS dropdown menu with two lists side by side?

Hybrid View

  1. #1
    Join Date
    May 2013
    Posts
    12

    resolved [RESOLVED] one CSS dropdown menu with two lists side by side?

    I would like the dropdown menu on this page - http://iphonebuy-host1.gaiahost.net/index.html - to be structured so that there are two lists side by side, with CDMA being the heading for one list and AT&T GSM being the heading for the other list. The thing is I want to have that box-shadow around both lists together - if I just turn them into two separate lists in my HTML, currently the CSS will put a box-shadow around each list separately.

    Can I make them display in the same container as two lists side by side? I know I've seen it on other sites (wish I could find an example right now) but don't know if they used CSS or jQuery/JS.

    HTML Code:
    <ul class="topnav">
          <li><a href="index.html" class="vertical-line">Home</a></li> 
          <li><a href="#" class="vertical-line">Get Quote</a>
    	     <ul>
    	      <li><span>Choose your phone</span></li>
    		  <li>CDMA</li>
    		  <li><a href="cdma3gs8gb">3GS 8GB</a></li>
    		  <li><a href="cdma3gs16gb">3GS 16GB</a></li>
    		  <li><a href="cdma4-8gb">4 8GB</a></li>
    		  <li><a href="cdma4-16gb">4 16GB</a></li>
    		  <li><a href="cdma4s16gb">4S 16GB</a></li>
    		  <li><a href="cdma4s32gb">4S 32GB</a></li>
    		  <li>AT&amp;T GSM</li>
    		  <li><a href="att3gs8gb">3GS 8GB</a></li>
    		  <li><a href="att3gs16gb">3GS 16GB</a></li>
    		  <li><a href="att4-8gb">4 8GB</a></li>
    		  <li><a href="att4-16gb">4 16GB</a></li>
    		  <li><a href="att4s16gb">4S 16GB</a></li>
    		  <li><a href="att4s32gb">4S 32GB</a></li>
    	    </ul>
    	  </li>
          <li><a href="about.html">About</a></li>
        </ul>
    Code:
    /** top navigation menu **/
      .topnav {
        list-style:none;
        background-color:#FFF;
        font:1.313em arial, sans-serif;
        color:#0071BC;
        margin:-1.8em 0 1.2em 25em;
        text-align:center;
      }
      
      .topnav li {
        position:relative;
        display:inline;
        padding:0 .5em 0 .5em;
      }
      
      .topnav a { 
        display:inline-block;
      }
      
    /** for drop-down menu **/
      .topnav ul {
        background:#fff;
        list-style:none;
        position:absolute;
        font:.9em arial, sans-serif;
        padding:.5em 0;
        left:-9999px;
        border-radius:.5em;
        -moz-box-shadow:    0 3px 2px 1px #ccc;
        -webkit-box-shadow: 0 3px 2px 1px #ccc;
        box-shadow:         0 3px 2px 1px #ccc;
      }  
      
      .topnav ul li {
        float:none;
        color:#95DF00;
      }
      
      .topnav ul li span {
        text-decoration:underline;
        white-space:nowrap;
      }
      
      .topnav ul a {
        white-space:nowrap;
        padding-top:.5em;
      }
      
      .topnav li:hover ul {
        left:0;
      }
      
      .topnav li:hover a {
        color:#99CCCC;
      }
    
      .topnav li:hover ul a {
        color:#0071BC;
      }
      
      .topnav li:hover ul a:hover {
        color:#99CCCC;
      }

  2. #2
    Join Date
    May 2013
    Posts
    1

  3. #3
    Join Date
    May 2013
    Posts
    12
    YES! Thank you, that is exactly what I needed

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles