Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    6
    Member #
    24213
    Hey everyone!

    I'm working on a website for my Air Force ROTC detachment, and I'm running into a few problems with the CSS Dropdown Menu.

    http://www.afrotc.huetetech.com

    For one, I can't figure out the best way to get it to center in the middle of the screen. For now, I have it with a padding of 25% of the left side, which bumps it to the middle on a 1280x1024 display... but when I look at it on my 1080p monitor, things get a little messed up. I know why it messes up, I just don't know a better way to do it.

    Also, an even bigger problem I'm having is that when I mouse-over a dropdown menu, it looks fine unless there is other content below it. When the menu tries to go over something, it goes under it instead. When there is a picture in the way, it goes underneath the picture completely. When it runs into text, it jumbles up with the text.

    Does anyone know some possible solutions to my 2 problems?

    Thanks!

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    For one, I can't figure out the best way to get it to center in the middle of the screen. For now, I have it with a padding of 25% of the left side, which bumps it to the middle on a 1280x1024 display... but when I look at it on my 1080p monitor, things get a little messed up. I know why it messes up, I just don't know a better way to do it.
    I took a look at your source and I can come up with a couple of suggestions -
    Try putting your <ul> inside a div with id="nav" (or some name you like).

    Code:
     <div id="nav">  
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="links.html">Air Force Links</a><ul>
            <li><a target="_blank" href="http://www.af.mil" class="type2">
            <span class="auto-style5">Air Force Home Page</span></a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.afrotc.com" class="type2">AFROTC Home 
            Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/au/holmcenter/" class="type2">
            Holm Center Home Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/msd/pubs/afoatsi/index.htm" class="type2">
            Holm Center Publications</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.e-publishing.af.mil/" class="type2">
            Air Force E-Publishing</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.leaderonline.af.mil/" class="type2">
            Air Force Leader Magazine Online</a></li>
        </ul>
        </li>
        <li><a href="scholarship.html">Scholarship Info</a></li>
        <li><a href="org.html">Organizations</a><ul>
            <li class="auto-style5"><a href="http://www.afa.org/">Air Force 
            Association</a></li>
            <li class="auto-style5"><a href="http://www.hagansquadron.com">Arnold 
            Air Society</a></li>
            <li class="auto-style5">
            <a href="http://www.pershingriflessociety.org/index.html">Pershing 
            Rifles</a></li>
            <li class="auto-style5"><a href="http://arnold-air.org/">Silver Wings</a></li>
        </ul>
        </li>
        <li><a href="info.html">Information</a><ul>
            <li class="auto-style5"><a href="cadet.html">Cadet Resources</a></li>
            <li class="auto-style5"><a href="about.html">Learn More</a></li>
            <li class="auto-style5"><a href="media.html">Multimedia</a></li>
        </ul>
        </li>
    </ul>
    </div><!-- end nav -->
    Then in your CSS

    Code:
    #nav { margin:auto; z-index:100;}
    When the menu tries to go over something, it goes under it instead. When there is a picture in the way, it goes underneath the picture completely. When it runs into text, it jumbles up with the text.
    Try giving your "nav" a z-index of 100 or something higher than the rest of the page content. (See CSS code above).
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    6
    Member #
    24213
    I implemented your code, but it seems to have no effect. The z-level of 100 has not caused the menu to appear on top, and it also is not centered at all now. It simply falls right next to HeaderLeft.

    edit: I'm also trying to center this flash image rotator now called CU3ER, but I can't get that to work right either >.<

  5. #4
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Jeez - I'm sorry!

    Can you post your code? Maybe I was reading it wrong from the source -
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  6. #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    6
    Member #
    24213
    HTML for two things that need to be centered:

    Code:
     <div id="nav">  
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="links.html">Air Force Links</a><ul>
            <li><a target="_blank" href="http://www.af.mil" class="type2">
            <span class="auto-style5">Air Force Home Page</span></a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.afrotc.com" class="type2">AFROTC Home 
            Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/au/holmcenter/" class="type2">
            Holm Center Home Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/msd/pubs/afoatsi/index.htm" class="type2">
            Holm Center Publications</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.e-publishing.af.mil/" class="type2">
            Air Force E-Publishing</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.leaderonline.af.mil/" class="type2">
            Air Force Leader Magazine Online</a></li>
        </ul>
        </li>
        <li><a href="scholarship.html">Scholarship Info</a></li>
        <li><a href="org.html">Organizations</a><ul>
            <li class="auto-style5"><a href="http://www.afa.org/">Air Force 
            Association</a></li>
            <li class="auto-style5"><a href="http://www.hagansquadron.com">Arnold 
            Air Society</a></li>
            <li class="auto-style5">
            <a href="http://www.pershingriflessociety.org/index.html">Pershing 
            Rifles</a></li>
            <li class="auto-style5"><a href="http://arnold-air.org/">Silver Wings</a></li>
        </ul>
        </li>
        <li><a href="info.html">Information</a><ul>
            <li class="auto-style5"><a href="cadet.html">Cadet Resources</a></li>
            <li class="auto-style5"><a href="about.html">Learn More</a></li>
            <li class="auto-style5"><a href="media.html">Multimedia</a></li>
        </ul>
        </li>
    </ul>
    </div><!-- end nav -->

    Code:
      <!-- CU3ER content HTML part starts here   -->
     <div id="CU3ER">
        <noscript>
          <!-- modify this content to provide users without Flash or enabled Javascript with alternative content information -->
          <p>Click to get Flash Player<br /><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
          <p>or try to enable JavaScript and reload the page
          </p>
        </noscript>
      </div>
      <!-- CU3ER content HTML part ends here   -->
    
    
    
    </p>
    CSS embeded with HTML:
    Code:
    <style type="text/css">
    
    .HeaderLeft {
        width: 15%;
        padding: 0px;
        margin: 0px;
        float: left;
    }
    .HeaderMid {
        width: 70%;
        padding: 0px;
        margin: 0px 0px 0px 5%;
        float: left;
        position: static;
    }
    .HeaderRight {
        margin: 0px;
        padding: 0px;
        float: right;
        width: 15%;
    }
    .Content {
        width: 50%;
        margin: 0px 25% 0px 25%;
        padding: 0px;
        left: 25%;
        right: 25%;
        text-align: center;
        color: #DDDDDD;
        font-family: Arial, Helvetica, sans-serif;
        z-index: 1;
    }
    .auto-style1 {
        text-align: center;
    }
    .auto-style2 {
        margin: 15px;
    }
    .auto-style4 {
        margin: 30px 15px;
    }
    .auto-style5 {
        text-align: center;
        font-size: xx-small;
    }
    ul li ul {
        visibility: hidden;
        z-index: 100;
    }
    ul li:hover ul {
        visibility: visible;
        z-index: 100;
    }
    </style>
    Main CSS Stylesheet:
    Code:
    body{
    	margin: 0px;
    	padding: 0px;
    	background-position: center;
    	body-top: 0;
    	clip: rect(0px, auto, auto, auto);
    	background-color: #000000;
    	background-image: url('midbg.jpg');
    	background-repeat: repeat-y;
    	background-attachment: fixed;
    }
    
    
    nav {
    	padding: 0px;
      margin-left: auto ;
      margin-right: auto ;
    	z-index: 100;
    }
    
    CU3ER {
    	width: 600px;
    	margin-left: auto;
    	margin-right: auto;
    	float: right;
    }
    
    }
    body-top:0;
    
    
    font {
    	color: #DDDDDD;
    	font-family: Arial, Helvetica, sans-serif;
    }

    Dropdown Menu CSS:
    Code:
    ul {
    	float: cente;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    	padding-top: 0px;
    	padding-right: 0px;
    	padding-bottom: 0px;
    	z-index: 100;
    }
    ul li {
    	display: inline;
    	float: left;
    	width: 150px;
    	list-style-type: none;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 0.9em;
    	text-transform: uppercase;
    	height: 35px;
    	z-index: 100;
    }
    ul li a {
    	background-color: #808080;
    	color: #FFFFFF;
    	text-decoration: none;
    	line-height: 35px;
    	width: 142px;
    	display: block;
    	padding-left: 8px;
    	z-index: 100;
    }
    ul li ul li a {
    	background-color: #666666;
    	z-index: 100;
    }
    ul li a:hover {
    	background-color: #333333;
    	z-index: 100;
    }

  7. #6
    Junior Member
    Join Date
    Oct 2010
    Posts
    6
    Member #
    24213
    I'm going to shamelessly bump this in the hopes that someone can help me!

    /commenceshamelessbump

  8. #7
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Hi - I fiddled with your code a bit - took all the inline styling out and put it in an external stylesheet with a reset at the beginning, re-sized one of the images, and added a couple of divs in the HTML, etc,

    and got this -
    http://www.danceriders.com/development/AF

    Of course I don't have your SWF or anything below the menu, but if you want I'll send you the files, and maybe you can build from there?


    Cheers,
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  9. #8
    Banned
    Join Date
    Oct 2010
    Posts
    11
    Member #
    24426
    Quote Originally Posted by megastealer View Post
    HTML for two things that need to be centered:

    Code:
     <div id="nav">  
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="links.html">Air Force Links</a><ul>
            <li><a target="_blank" href="http://www.af.mil" class="type2">
            <span class="auto-style5">Air Force Home Page</span></a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.afrotc.com" class="type2">AFROTC Home 
            Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/au/holmcenter/" class="type2">
            Holm Center Home Page</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.au.af.mil/msd/pubs/afoatsi/index.htm" class="type2">
            Holm Center Publications</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.e-publishing.af.mil/" class="type2">
            Air Force E-Publishing</a></li>
            <li class="auto-style5">
            <a target="blank" href="http://www.leaderonline.af.mil/" class="type2">
            Air Force Leader Magazine Online</a></li>
        </ul>
        </li>
        <li><a href="scholarship.html">Scholarship Info</a></li>
        <li><a href="org.html">Organizations</a><ul>
            <li class="auto-style5"><a href="http://www.afa.org/">Air Force 
            Association</a></li>
            <li class="auto-style5"><a href="http://www.hagansquadron.com">Arnold 
            Air Society</a></li>
            <li class="auto-style5">
            <a href="http://www.pershingriflessociety.org/index.html">Pershing 
            Rifles</a></li>
            <li class="auto-style5"><a href="http://arnold-air.org/">Silver Wings</a></li>
        </ul>
        </li>
        <li><a href="info.html">Information</a><ul>
            <li class="auto-style5"><a href="cadet.html">Cadet Resources</a></li>
            <li class="auto-style5"><a href="about.html">Learn More</a></li>
            <li class="auto-style5"><a href="media.html">Multimedia</a></li>
        </ul>
        </li>
    </ul>
    </div><!-- end nav -->

    Code:
      <!-- CU3ER content HTML part starts here   -->
     <div id="CU3ER">
        <noscript>
          <!-- modify this content to provide users without Flash or enabled Javascript with alternative content information -->
          <p>Click to get Flash Player<br /><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
          <p>or try to enable JavaScript and reload the page
          </p>
        </noscript>
      </div>
      <!-- CU3ER content HTML part ends here   -->
    
    
    
    </p>
    CSS embeded with HTML:
    Code:
    <style type="text/css">
    
    .HeaderLeft {
        width: 15%;
        padding: 0px;
        margin: 0px;
        float: left;
    }
    .HeaderMid {
        width: 70%;
        padding: 0px;
        margin: 0px 0px 0px 5%;
        float: left;
        position: static;
    }
    .HeaderRight {
        margin: 0px;
        padding: 0px;
        float: right;
        width: 15%;
    }
    .Content {
        width: 50%;
        margin: 0px 25% 0px 25%;
        padding: 0px;
        left: 25%;
        right: 25%;
        text-align: center;
        color: #DDDDDD;
        font-family: Arial, Helvetica, sans-serif;
        z-index: 1;
    }
    .auto-style1 {
        text-align: center;
    }
    .auto-style2 {
        margin: 15px;
    }
    .auto-style4 {
        margin: 30px 15px;
    }
    .auto-style5 {
        text-align: center;
        font-size: xx-small;
    }
    ul li ul {
        visibility: hidden;
        z-index: 100;
    }
    ul li:hover ul {
        visibility: visible;
        z-index: 100;
    }
    </style>
    Main CSS Stylesheet:
    Code:
    body{
    	margin: 0px;
    	padding: 0px;
    	background-position: center;
    	body-top: 0;
    	clip: rect(0px, auto, auto, auto);
    	background-color: #000000;
    	background-image: url('midbg.jpg');
    	background-repeat: repeat-y;
    	background-attachment: fixed;
    }
    
    
    nav {
    	padding: 0px;
      margin-left: auto ;
      margin-right: auto ;
    	z-index: 100;
    }
    
    CU3ER {
    	width: 600px;
    	margin-left: auto;
    	margin-right: auto;
    	float: right;
    }
    
    }
    body-top:0;
    
    
    font {
    	color: #DDDDDD;
    	font-family: Arial, Helvetica, sans-serif;
    }

    Dropdown Menu CSS:
    Code:
    ul {
    	float: cente;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    	padding-top: 0px;
    	padding-right: 0px;
    	padding-bottom: 0px;
    	z-index: 100;
    }
    ul li {
    	display: inline;
    	float: left;
    	width: 150px;
    	list-style-type: none;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 0.9em;
    	text-transform: uppercase;
    	height: 35px;
    	z-index: 100;
    }
    ul li a {
    	background-color: #808080;
    	color: #FFFFFF;
    	text-decoration: none;
    	line-height: 35px;
    	width: 142px;
    	display: block;
    	padding-left: 8px;
    	z-index: 100;
    }
    ul li ul li a {
    	background-color: #666666;
    	z-index: 100;
    }
    ul li a:hover {
    	background-color: #333333;
    	z-index: 100;
    }
    Thanks it is very useful code

  10. #9
    Junior Member
    Join Date
    Oct 2010
    Posts
    6
    Member #
    24213
    Quote Originally Posted by AlphaMare View Post
    Hi - I fiddled with your code a bit - took all the inline styling out and put it in an external stylesheet with a reset at the beginning, re-sized one of the images, and added a couple of divs in the HTML, etc,

    and got this -
    Untitled 1

    Of course I don't have your SWF or anything below the menu, but if you want I'll send you the files, and maybe you can build from there?


    Cheers,
    Hey, that looks pretty good. Could you put an image or something underneath the menu and see if the dropdown items get hidden beneath it?

  11. #10
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I have a really busy family and work week coming up - I'll see what I can do but I can't promise anything - why don't you just take the code and fiddle with it yourself?

    Attachment 3490

    Use the same javascript - I didn't touch that at all.

    Cheers,
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:08 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com